package net;

import engine.ani.Npc;
import engine.ani.Player;
import engine.damage.Damage;
import engine.goods.Goods;
import engine.map.Map;
import engine.net.NetManager;
import engine.skill.SkillBuff;
import engine.skill.SkillBuffManager;
import engine.skill.SkillManager;
import function.Pet;
import function.QuickOption;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Vector;
import javax.microedition.lcdui.Image;
import mainpackage.Constant;
import mainpackage.GameBean;
import mainpackage.InputInterFace;
import mainpackage.LocalMsgManager;
import mainpackage.MainCanvas;
import mainpackage.MainGame;
import mainpackage.MainLogic;
import mainpackage.ResManager;
import mainpackage.Rms;
import mainpackage.Tools;
import ui.UiEquipment;
import ui.UiInterFace;
import ui.UiLogin;

/**
 * <p>Title: 网络数据处里类</p>
 * <p>Description: 主要负责解析和封装网络收发的数据包</p>
 * <p>Copyright: Copyright (c) 2010</p>
 * <p>Company: </p>
 * @author hlw
 * @version 1.0
 */
public class NetController {

    private static NetController instance = null;
    private static NetDataPro aNetDataPro;

    public NetController() {
        this.veNetMsgQueue = new Vector();
        this.veNetMsgQueue.addElement(new Vector());
        this.receiveQueue = new Vector(30, 10);
        this.iNetConnectTimeOut = 30000;
        instance = this;
        aNetDataPro = new NetDataPro();
    }

    public static NetController getInstance() {
        return instance;
    }
    //网络部分
    private Vector veNetMsgQueue;
    //创建接收消息队列
    public Vector receiveQueue;
    //网络连接超时时间
    public int iNetConnectTimeOut;
    //短连接用连接串
    public String strShortIp;
    //短连接用用户登录口令
    public int iShortAccountId;
    //短连接用用户登录ID
    public int iShortRoleId;
//短连接用消息体数组
    public byte[] byShortMsgData;
//从服务器申请资源的ID数组
    public Vector iNetImgRequestArray = null;

    public final void receiveResponse(byte[] byNetData, int msgId, byte msgType) throws Exception {
        //消息体读取处理
        ByteArrayInputStream byIn = new ByteArrayInputStream(byNetData);
        DataInputStream dIn = new DataInputStream(byIn);
        byte[] data = null;
        //状态码
        byte stateCode = 0;
        //消息长度
        int msgLen = 0;
        //消息队列用消息数据
        byte[] msgData = null;
        //消息队列用消息整合处理流
        ByteArrayOutputStream byOut = null;
        DataOutputStream dOut = null;
//        Tools.printLog("recive(MSG_ID):" + msgId);
        try {
            //读取消息数量
            //int nums = dIn.readInt();
            int nums = 1;
            ByteArrayInputStream cmdIn;
            DataInputStream cmdData;
            for (int i = 0; i < nums; i++) {
                //读取消息长度
                msgLen = byNetData.length;
                data = new byte[msgLen];
                //读取消息体
                dIn.read(data);
                //解析具体协议
                cmdIn = new ByteArrayInputStream(data);
                if (Constant.bTestFlow) {
                    MainLogic.lFlowCount += cmdIn.available();
                }
                cmdData = new DataInputStream(cmdIn);
                MainLogic.getInstance().i_receive_msgId = msgId;
                //逻辑类消息
                if (msgType == Constant.SOCKET_MSG_TYPE_LOGIC) {
                    switch (msgId) {
                        //创建角色
                        case Constant.MSG_NET_CMD_GET_ROLES:
                        case Constant.MSG_NET_CREATE_ROLE:
                        case Constant.MSG_NET_ENTER_WORLD:
                        case Constant.MSG_NET_CMD_ENTER_SCENE:
                        case Constant.MSG_NET_PLAYER_ON_SCREEN_BATTLE:
                        case Constant.MSG_NET_BATTLE:
                        case Constant.MSG_NET_LEARN_SKILL:
                        case Constant.MSG_NET_ADD_SKILL_PLACE:
                        case Constant.MSG_NET_UNLEARN_SKILL:
                        case Constant.MSG_NET_LEARN_MERIDIAN:
                        case Constant.MSG_NET_QUIT_GAME:
                        case Constant.MSG_NET_CMD_NPC:
                        case Constant.MSG_NET_CMD_QUEST:
                        case Constant.MSG_NET_XCHANGE_SCENE:
                        case Constant.MSG_NET_CMD_OPEN_BAG:
                        case Constant.MSG_NET_CMD_ADD_ITEM:
                        case Constant.MSG_NET_CMD_DELETE_ITEM:
                        case Constant.MSG_NET_CMD_SORT_ITEM:
                        case Constant.MSG_NET_CMD_CHECK_ITEM:
                        case Constant.MSG_NET_CMD_OPEN_EQUIP:
                        case Constant.MSG_NET_CMD_USE_EQUIP:
                        case Constant.MSG_NET_CMD_DELETE_EQUIP:
                        case Constant.MSG_NET_CMD_CHECK_DESC:
                        case Constant.MSG_NET_DIFF_EQUIP:
                        case Constant.MSG_NET_CMD_USE_ITEM:
                        case Constant.MSG_NET_CMD_FIND_PATH:
                        case Constant.MSG_NET_CMD_TIPS:
                        case Constant.MSG_NET_CMD_ADD_MITZVAH:
                        case Constant.MSG_NET_CMD_TEAM_JOIN:
                        case Constant.MSG_NET_CMD_TEAM_ANSWER:
                        case Constant.MSG_NET_CMD_TEAM_INFO:
                        case Constant.MSG_NET_OPEN_KUNGFU:
                        case Constant.MSG_NET_CHECK_SKILL:
                        case Constant.MSG_NET_CMD_SET_FLOW:
                        case Constant.MSG_NET_CMD_SHOUT:
                        case Constant.MSG_NET_CREATE_TONG:
                        case Constant.MSG_NET_CMD_APPLICATION_TONG:
                        case Constant.MSG_NET_CMD_TONG_LIST:
                        case Constant.MSG_NET_CMD_TONG_MEMBER_LIST:
                        case Constant.MSG_NET_INVITE_TONG:
                        case Constant.MSG_NET_BUFF_OPT:
                        case Constant.MSG_NET_CMD_QUEST_LIST:
                        case Constant.MSG_NET_CMD_FUNC_TONG_TRANS:
                        case Constant.MSG_NET_CMD_DELETE_BUFF:
                        case Constant.MSG_NET_CMD_TEAM_DISMISS:
                        case Constant.MSG_NET_CMD_TEAM_LEAVE:
                        case Constant.MSG_NET_CMD_TEAM_CHANGE_LEADER:
                        case Constant.MSG_NET_CMD_FUNC_COMPOSE:
                        case Constant.MSG_NET_CMD_FUNC_DECOMPOSE:
                        case Constant.MSG_NET_CMD_QUEST_INFO:
                        case Constant.MSG_NET_CMD_TONG_LEAVE:
                        case Constant.MSG_NET_TONG_CHANGE_DESCRIPT:
                        case Constant.MSG_NET_TONG_NPC_UPGRADE://帮派NPC建筑升级
                        case Constant.MSG_NET_TONG_NPC_INFO://帮派NPC等级
                        case Constant.MSG_NET_CMD_TONG_DESCRIPT:
                        case Constant.MSG_NET_CMD_TONG_DISMISS:
                        case Constant.MSG_NET_CMD_TONG_CHANGE_POSITION:
                        case Constant.MSG_NET_CMD_OPEN_PET:
                        case Constant.MSG_NET_CMD_DELETE_PET:
                        case Constant.MSG_NET_CMD_PET_FEED:
                        case Constant.MSG_NET_CMD_USE_PET:
                        case Constant.MSG_NET_CMD_CHECK_PET:
                        case Constant.MSG_NET_CMD_FUNC_PETSTRENGTH:
                        case Constant.MSG_NET_CMD_FUNC_PET_COMPOSE:
                        case Constant.MSG_NET_CMD_SELECT_PETSTRENGTH_ITEM:
                        case Constant.MSG_NET_CMD_NPC_INFO:
                        case Constant.MSG_NET_CMD_OTHER_PLAYER_INFO:
                        case Constant.MSG_NET_CMD_ADD_MONEY:
                        case Constant.MSG_NET_CMD_SELECT_PETCOMPOSE_ITEM:
                        case Constant.MSG_NET_CMD_MOVE_ITEM:
                        case Constant.MSG_NET_MODIFY_POSITION:
                        case Constant.MSG_NET_CMD_FUNC_COMPOSE_MONEY:
                        case Constant.MSG_NET_CMD_FUNC_DECOMPOSE_MONEY:
                        case Constant.MSG_NET_CMD_FUNC_HOLE:
                        case Constant.MSG_NET_CMD_FUNC_INLAY:
                        case Constant.MSG_NET_CMD_FUNC_HOLE_MONEY:
                        case Constant.MSG_NET_CMD_FUNC_INLAY_MONEY:
                        case Constant.MSG_NET_CMD_FUNC_STRENGTH:
                        case Constant.MSG_NET_CMD_FUNC_STRENGTH_MONEY:
                        case Constant.MSG_NET_CMD_FUNC_STRENGTH_RATE:
                        case Constant.MSG_NET_CMD_ADD_FRIEND:
                        case Constant.MSG_NET_CMD_BE_ADD_FRIEND:
                        case Constant.MSG_NET_CMD_FRIEND_LIST:
                        case Constant.MSG_NET_CMD_DEL_FREIND:
                        case Constant.MSG_NET_CMD_ADD_CONTANT:
                        case Constant.MSG_NET_CMD_OPEN_NPC_STORE:
                        case Constant.MSG_NET_CMD_FUNC_STORE:
                        case Constant.MSG_NET_CMD_OPEN_MERIDIAN:
                        case Constant.MSG_NET_GET_MERIDIAN_DESC:
                        case Constant.MSG_NET_CMD_MAIL_HINT:
                        case Constant.MSG_NET_CMD_MAIL_CHECKUSER:
                        case Constant.MSG_NET_CMD_CHECK_MONEY:
                        case Constant.MSG_NET_CMD_MAIL_MONEY:
                        case Constant.MSG_NET_CMD_MAIL_POST:
                        case Constant.MSG_NET_CMD_MAIL_OPEARTION:
                        case Constant.MSG_NET_CMD_CHECK_STORE_ITEM:
                        case Constant.MSG_NET_CMD_CHECK_STORE_DESC:
                        case Constant.MSG_NET_CMD_OPEN_DEPOT:
                        case Constant.MSG_NET_CMD_FUNC_DEPOT:
                        case Constant.MSG_NET_CMD_LOGIN:
                        case Constant.MSG_NET_CMD_TRADE_JOIN:
                        case Constant.MSG_NET_CMD_TRADE_ANSWER:
                        case Constant.MSG_NET_CMD_TRADE_CANCEL:
                        case Constant.MSG_NET_CMD_SYNC_TRADE_ITEM:
                        case Constant.MSG_NET_CMD_TRADE:
                        case Constant.MSG_NET_CMD_LOCK_TRADE:
                        case Constant.MSG_NET_CMD_IDEAD:
                        case Constant.MSG_NET_CMD_ADD_EXP:
                        case Constant.MSG_NET_CMD_ADD_ATTR_POINT:
                        case Constant.MSG_NET_CMD_GET_SERIES_INFO:
                        case Constant.MSG_NET_CMD_PK:
                        case Constant.MSG_NET_CMD_SOCIAL:
                        case Constant.MSG_NET_CMD_FUNC_REPAIR:
                        case Constant.MSG_NET_CMD_GET_REPAIR_FEE:
                        case Constant.MSG_NET_CMD_PET_LOCK_SKILL:
                        case Constant.MSG_NET_CMD_PET_BIND:
                        case Constant.MSG_NET_CMD_CHANGE_STATE:
                        case Constant.MSG_NET_CMD_FUNC_HOLE_INFO:
                        case Constant.MSG_NET_CMD_FUNC_DISMANTLE:
//                        case Constant.MSG_NET_CMDI_EXIT_GAME:
                        case Constant.MSG_NET_CMD_FUNC_PET_COMPOSE_MONET:
                        case Constant.MSG_NET_CMD_SYNC_HEALTH:
                        case Constant.MSG_NET_CMD_SYNC_MANA:
                        case Constant.MSG_NET_CMD_SYNC_PK:
                        case Constant.MSG_NET_CMD_OPT_ON_SCREEN:
                        case Constant.MSG_NET_CMD_SET_QUICK:
                        case Constant.MSG_NET_CMD_TEAM_ITEM:
                        case Constant.MSG_NET_CMD_TEAM_ROLL:
                        case Constant.MSG_NET_CMD_APPLY_TONG_ARENA:
                        case Constant.MSG_NET_CMD_SEND_TONG_ARENA:
                        case Constant.MSG_NET_CMD_DELETE_QUEST:
                        case Constant.MSG_NET_CMD_FUNC_SEND:
                        case Constant.MSG_NET_CMD_PET_CHANGE_ALIAS:
                        case Constant.MSG_NET_CMD_PET_DEFEND:
                        case Constant.MSG_NET_CMD_CHECK_NEAR_PLAYERS:
                        case Constant.MSG_NET_CMD_OTHER_PLAYER_DETAIL:
                        case Constant.MSG_NET_CMD_SELECT_PET_POTENTIAL_ITEM:
                        case Constant.MSG_NET_CMD_PET_FUNC_POTENTIAL_EXCITE:
                        case Constant.MSG_NET_CMD_PET_EQUIP_USE:
                        case Constant.MSG_NET_CMD_CHANGE_AVATAR:
                        case Constant.MSG_NET_CMD_GET_SEND_POINT:
                        case Constant.MSG_NET_CMD_QUEST_FIND_PATH:
                        case Constant.MSG_NET_CMD_EQUIP_BIND:
                        case Constant.MSG_NET_CMD_QUIT_CONTEST:
                        case Constant.MSG_NET_CMD_DELETE_NPC:
                        case Constant.MSG_NET_CMD_GET_APPLY_TONG_LIST:
                        case Constant.MSG_NET_CMD_SEND_ARENA_INTEGRAL:
                        case Constant.MSG_NET_CMD_INSTALL_BUFF:
                        case Constant.MSG_NET_CMD_DELETE_PLAYER:
                        case Constant.MSG_NET_CMD_QUEST_SIMPLE_INFO:
                        case Constant.MSG_NET_CMD_TIPS_CODE:
                        case Constant.MSG_NET_CMD_PUT_ITEM:
                        case Constant.MSG_NET_CMD_QUESTION_INFO:
                        case Constant.MSG_NET_CMD_QUESTION_RUN:
                        case Constant.MSG_NET_CMD_QUESTION_END:
                        case Constant.MSG_NET_OTHER_PLAYER_INFO:
                        case Constant.MSG_NET_CMD_CLIENT_READY:
                        case Constant.MSG_NET_CMD_GAME_TIME:
                        case Constant.MSG_NET_CMD_OPEN_INGOT_STORE:
                        //购买元宝商城东西
                        case Constant.MSG_NET_CMD_FUNC_INGOT_BUY:
                        //我的收藏和购买记录
                        case Constant.MSG_NET_CMD_MY_INGOT_RECORD:
                        //收藏和取消收藏
                        case Constant.MSG_NET_CMD_FUNC_STORE_ITEM_COLLECT:
                        //赠送
                        case Constant.MSG_NET_CMD_FUNC_STORE_GIFT:
                        case Constant.MSG_NET_CMD_CHECK_PROPERTY:
                        case Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT:
                        case Constant.MSG_NET_CMD_CONTINUE_EFFECT:
                        case Constant.ACT_NPC_MISSION_ACCEPT:
                        case Constant.MSG_NET_CMD_CLEAN_EFFECT:
                        case Constant.MSG_NET_CMD_CHECK_MEFFECT:
                        case Constant.MSG_NET_CMD_CMD_SET_VERSION:
                        case Constant.MSG_NET_CMD_CMD_NOTICE:
                        case Constant.MSG_NET_CMD_NOTICE_LIST:
                        case Constant.MSG_NET_CMD_CHANGE_PASSWORD:
                        case Constant.MSG_NET_CMD_CMD_GUIDE:
                        //玩家排行榜
                        case Constant.MSG_NET_CMD_PLAYER_TOP:
                        //打开玩家的摊位
                        case Constant.MSG_NET_CMD_BUSINESS_OPEN:
                        //调整摊位出售的物品
                        case Constant.MSG_NET_CMD_BUSINESS_OPT:
                        //购买玩家摊位出售的物品
                        case Constant.MSG_NET_CMD_BUSINESS_BUY:
                        //查看玩家的称号
                        case Constant.MSG_NET_CMD_CHECK_PLAYER_NICK:
                        //设置玩家的当前称号
                        case Constant.MSG_NET_CMD_SET_PLAYER_NICK:
                        case Constant.MSG_NET_CMD_COUNT_BOX:
                        case Constant.MSG_NET_CMD_HANGUP_START://开启离线挂机
                        case Constant.MSG_NET_CMD_OFFLINEHANG_OPEN://打开离线挂机界面
                        case Constant.MSG_NET_CMD_OFFLINEHANG_EXTRACT://提取挂机经验
                        case Constant.MSG_NET_CMD_ONLINEHANG_UI://打开在线挂机界面
                        case Constant.MSG_NET_CMD_ONLINEHANG://在线挂机设置
                        case Constant.MSG_NET_CMD_NPC_CHANGE:
                        case Constant.MSG_NET_CMD_ACTIVATION://激活码
                        case Constant.MSG_NET_CMD_CHARGE://充值
                        case Constant.MSG_NET_CMD_CHARGE_LIST://充值明细
                        case Constant.MSG_NET_CMD_LOAD_OTHER://载入玩家的其他信息
                            byOut = new ByteArrayOutputStream();
                            dOut = new DataOutputStream(byOut);
                            dOut.writeByte(msgType); //
                            dOut.writeInt(msgId); //
                            dOut.writeInt(msgLen);//
                            dOut.write(data); //
                            msgData = byOut.toByteArray();
                            this.putNetMsg(msgData);
                            dOut.close();
                            byOut.close();
                            dOut = null;
                            byOut = null;
                            msgData = null;
                            break;
                        case Constant.MSG_NET_CMDI_EXIT_GAME:
                            long playerID = cmdData.readLong();
                            Tools.printLog("删除玩家：" + playerID);
                            if (MainLogic.getInstance().gameOtherplayerArray != null && MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)) != null) {
                                MainLogic.getInstance().gameOtherplayerArray.deleteOther((int) ((Integer) (MainLogic.getInstance().gameOtherplayerArray.repeatTable.get(new Long(playerID)))).intValue());
                            }
                            break;
                    }
                }
                if (msgType == Constant.SOCKET_MSG_TYPE_RES) { //资源类消息
                    switch (msgId) {
                        case Constant.MSG_NET_GET_IMAGE:
                        case Constant.MSG_NET_GET_ANIMATION:
                        case Constant.MSG_NET_GET_TERRAIN:
                            byOut = new ByteArrayOutputStream();
                            dOut = new DataOutputStream(byOut);
                            dOut.writeByte(msgType); //type
                            dOut.writeInt(msgId); //��id
                            dOut.writeInt(msgLen);//��
                            dOut.write(data); //�
                            msgData = byOut.toByteArray();
                            this.putNetMsg(msgData);
                            dOut.close();
                            byOut.close();
                            dOut = null;
                            byOut = null;
                            msgData = null;
                            break;
                    }
                }
            }
            if (byIn != null) {
                byIn.close();
                byIn = null;
            }
            if (dIn != null) {
                dIn.close();
                dIn = null;
            }
        } catch (Exception ex) {
            if (Constant.DEBUG) {
                ex.printStackTrace();
            }
        }
    }

    public boolean blCanReceive(int msgid) {
        if (!MainLogic.blLogined) {
            switch (msgid) {
                case Constant.MSG_NET_CMD_LOGIN:
                case Constant.MSG_NET_CMD_GET_ROLES:
                case Constant.MSG_NET_CREATE_ROLE:
                case Constant.MSG_NET_ENTER_WORLD:
                case Constant.MSG_NET_CMD_ENTER_SCENE:
                case Constant.MSG_NET_QUIT_GAME:
                case Constant.MSG_NET_CMD_SET_QUICK:
                case Constant.MSG_NET_CMD_OPT_ON_SCREEN:
                case Constant.MSG_NET_CMD_CMD_SET_VERSION:
                case Constant.MSG_NET_CMD_CMD_NOTICE:
                case Constant.MSG_NET_CMD_NOTICE_LIST:
                case Constant.MSG_NET_CMD_LOAD_OTHER:
                    return true;
            }
            return false;
        } else {
            return true;
        }
    }
    //在frame间隔内处理的网络消息

    public void runMessageQueue() {
        int size = this.getVectorNums();
        //已处理的消息数量
        int iTreadNum = 0;
        try {
            //调试状态生成调试信息
//            if (Constant.DEBUG) {
//                MainCanvas.pushCallStack("runMessageQueue()");
//            }
            //消息队列里消息组的数量

            //当前消息组
            Vector curVe;
            //当前消息包
            byte[] byNetMsgData = null;
            //消息读取接口定义
            ByteArrayInputStream byIn;
            DataInputStream dIn;
            ByteArrayInputStream cmdIn;
            DataInputStream cmdData;
            //消息体参数
            byte[] data = null;
            //状态码
            byte stateCode = 0;
            //读取消息id
            int msgId = 0;
            //读取消息长度
            int msgLen = 0;
            byte msgType = 0;
            int fixed = 0;
            long fixed2 = 0L;
            String strfixed2 = null;
            int curveSize = 0;
            //在frame间隔处理消息队列中最大数量为QUEUE_MESSAGE_NUMS的消息
            while (size > 0 && iTreadNum < Constant.QUEUE_MESSAGE_NUMS) {
                try {
                    curVe = this.getFirstVector();
                    curveSize = curVe.size();
                    int imsgindex = 0;
                    int i = 0;
                    for (imsgindex = 0; imsgindex < curveSize; imsgindex++) {
                        byNetMsgData = (byte[]) curVe.elementAt(imsgindex);
                        if (byNetMsgData != null) {
                            byIn = new ByteArrayInputStream(byNetMsgData);
                            dIn = new DataInputStream(byIn);
                            msgType = dIn.readByte();
                            //读取消息id
                            msgId = dIn.readInt();
                            //读取消息长度
                            msgLen = dIn.readInt();
                            data = new byte[msgLen];
                            //读取消息体
                            dIn.read(data);
                            //解析具体协议
                            cmdIn = new ByteArrayInputStream(data);
                            cmdData = new DataInputStream(cmdIn);
                            int imgId = 0;
                            int shImgLen;
                            int iImgLen;
                            byte[] byImgData = null;
                            int nums;
                            String SsceneKey = null;
                            String SsceneName = null;
                            //玩家状态
                            byte byPlayerState;
                            //速度
                            short shSpeed;
                            //朝向
                            byte byTowardsx;
                            int j = 0;
                            //坐标
                            if (msgId != 143) {
                                Tools.printLog("receive message:" + msgId);
                            }
//                        int playerx;
//                        int playery;
                            if (msgType == Constant.SOCKET_MSG_TYPE_LOGIC && blCanReceive(msgId)) {
                            	receiveLogicMSG(msgId, cmdData);
                            } else {
                                switch (msgId) {
                                    case Constant.MSG_NET_GET_IMAGE:
                                        //获得图片资源
                                        fixed = cmdData.readShort();
                                        fixed2 = cmdData.readLong();
                                        nums = cmdData.readShort();
                                        if (fixed == Constant.RES_PUBLIC_ONEROOM && fixed2 == Constant.NET_TYPE_NPC_IMAGE) {
                                            int id = -1;
                                            for (j = 0; j < nums; j++) {
                                                //读图片数据
                                                id = cmdData.readInt();
                                                Tools.printLog("得到网络图片" + id);
                                                shImgLen = cmdData.readInt();
                                                byImgData = new byte[shImgLen];
                                                cmdData.read(byImgData);
                                                ResManager.createImage(id, Constant.RES_PUBLIC_ONEROOM, byImgData);
                                                byImgData = null;
                                            }
                                            if (MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf != null && MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf.length > 0) {
                                                GameBean.SH_RES_PARAMETER_ONE = Constant.RES_PUBLIC_ONEROOM;
                                                GameBean.SH_RES_PARAMETER_TWO = Constant.NET_TYPE_GET_NPC_ANIMATION;
                                                this.setMsgResArray(MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf);
                                                this.send(Constant.MSG_NET_GET_ANIMATION, Constant.SOCKET_MSG_TYPE_RES);
//                                        MainCanvas.strLoadingNOte = "发送请求npc动画nums"+MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf.length;
                                                MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf = null;

                                            } else {
                                                MainLogic.getInstance().gameNpcArray.loadNpcRes();
                                            }
                                        } else {
                                            for (j = 0; j < nums; j++) {
                                                //读图片数据
                                                imgId = cmdData.readInt();
                                                shImgLen = cmdData.readInt();
                                                Tools.printLog("得到网络图片" + imgId);
                                                byImgData = new byte[shImgLen];
                                                cmdData.read(byImgData);
                                                if (fixed2 == Constant.NET_TYPE_MAP_IMAGE_2) {
                                                    ResManager.createImage(imgId, (byte) fixed, byImgData, Constant.NET_TYPE_MAP_IMAGE_2);
                                                } else {
                                                    ResManager.createImage(imgId, (byte) fixed, byImgData);
                                                }
                                                byImgData = null;
                                            }
//                                         System.gc();
                                            if (fixed2 == Constant.NET_TYPE_MAP_IMAGE_2) {
//                                              MainCanvas.strLoadingNOte = "加载地图大图";
//                                               if (Constant.DEBUG)
//                                      {
//                                       MainCanvas.addLog(MainCanvas.strLoadingNOte);
//                                      }
                                                if (MainLogic.getInstance().gameNpcArray.strNpcResImgIdBuf != null && MainLogic.getInstance().gameNpcArray.strNpcResImgIdBuf.length > 0) {
                                                    MainLogic.netController.setMsgResArray(MainLogic.getInstance().gameNpcArray.strNpcResImgIdBuf);
                                                    GameBean.SH_RES_PARAMETER_ONE = Constant.RES_PUBLIC_ONEROOM;
                                                    GameBean.SH_RES_PARAMETER_TWO = Constant.NET_TYPE_NPC_IMAGE;
                                                    MainLogic.netController.send(Constant.MSG_NET_GET_IMAGE, Constant.SOCKET_MSG_TYPE_RES);
                                                    MainLogic.getInstance().gameNpcArray.strNpcResImgIdBuf = null;
                                                    UiInterFace.byMaxLoadingNum = (byte) 90;
                                                    if (Constant.DEBUG) {
//                                                        System.out.println("NET_TYPE_NPC_IMAGE");
                                                        MainCanvas.addLog("NET_TYPE_NPC_IMAGE");
                                                    }
                                                    //
                                                } else {
                                                    if (MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf != null && MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf.length > 0) {
                                                        GameBean.SH_RES_PARAMETER_ONE = Constant.RES_PUBLIC_ONEROOM;
                                                        GameBean.SH_RES_PARAMETER_TWO = Constant.NET_TYPE_GET_NPC_ANIMATION;
                                                        this.setMsgResArray(MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf);
                                                        this.send(Constant.MSG_NET_GET_ANIMATION, Constant.SOCKET_MSG_TYPE_RES);
//                                        MainCanvas.strLoadingNOte = "发送请求npc动画nums"+MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf.length;
                                                        MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf = null;
//                                        if (Constant.DEBUG)
//                                      {
//                                       MainCanvas.addLog(MainCanvas.strLoadingNOte);
//                                      }
                                                    }
                                                }
//                                         MainLogic.getInstance().gameNpcArray.loadNpcRes();
                                            }
                                        }
                                        break;
                                    case Constant.MSG_NET_GET_ANIMATION:
                                        fixed = cmdData.readShort();
                                        strfixed2 = cmdData.readUTF();
                                        nums = cmdData.readShort();
                                        Tools.printLog("animatnums" + nums + "fixed:" + fixed + "fixed2:" + fixed2);
                                        if (strfixed2.indexOf(",") == -1) {
                                            fixed2 = Long.parseLong(strfixed2);
                                        }
//                                    if (nums <= 0) {
//                                        break;
//                                    }
//                                    MainCanvas.strLoadingNOte = "Ani"+"n:"+nums+"sz:"+cmdData.available()+"fixed2:"+fixed2;
//                                     if (Constant.DEBUG)
//                                      {
//                                       MainCanvas.addLog(MainCanvas.strLoadingNOte);
//                                      }
                                        ResManager.BL_RECEIVE_NET_ANIMATION = true;
                                        if (fixed == Constant.RES_PUBLIC_ONEROOM && fixed2 == Constant.NET_TYPE_GET_NPC_ANIMATION) {
//                                        if (MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf == null) {
//                                          MainCanvas.strLoadingNOte = "加载npcani";
//                                       if (Constant.DEBUG)
//                                      {
//                                       MainCanvas.addLog(MainCanvas.strLoadingNOte);
//                                      }
//                                        MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf = new String[nums];
//                                        }
                                            int id = -1;
                                            for (j = 0; j < nums; j++) {
                                                //读图片数据
                                                id = cmdData.readInt();
//                                            Tools.printLog("MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf[j]" + MainLogic.getInstance().gameNpcArray.strNpcResAniIdBuf[j]);
                                                shImgLen = cmdData.readShort();
                                                Tools.printLog("得到网络动画" + id);
                                                byImgData = new byte[shImgLen];
                                                cmdData.read(byImgData);
                                                ResManager.loadAnimation(id, Constant.RES_PUBLIC_ONEROOM, byImgData, true);
                                                byImgData = null;
                                            }
                                            cmdData = null;
//                                        System.gc();
                                            MainLogic.getInstance().gameNpcArray.loadNpcRes();

//                                        Rms.saveGame(Constant.RMS_ONE_ROOM_IMAGE, null);
                                        } else {
                                            //测试用要去掉
                                            for (j = 0; j < nums; j++) {
                                                imgId = cmdData.readInt();
                                                Tools.printLog("得到网络动画" + imgId);
                                                shImgLen = cmdData.readShort();
                                                byImgData = new byte[shImgLen];
                                                cmdData.read(byImgData);
                                                ResManager.loadAnimation(imgId, (byte) fixed, byImgData, true);
                                                byImgData = null;
                                            }
                                            System.gc();
                                        }
                                        break;
                                    case Constant.MSG_NET_GET_TERRAIN:
//                                    fixed = cmdData.readShort();
//                                    fixed2 = cmdData.readLong();
//                                    nums = cmdData.readShort();
//                                    for (int j = 0; j < nums; j++) {
                                        //读地图数据
                                        imgId = cmdData.readInt();
//                                        iImgLen = cmdData.readInt();
//                                    }
//                                    MainCanvas.strLoadingNOte = "net开始加载地图";
//                                     if (Constant.DEBUG)
//                                      {
//                                       MainCanvas.addLog(MainCanvas.strLoadingNOte);
//                                      }
                                        if (imgId != 0) {
                                            MainLogic.gameMap.initMapData(cmdData, true);
                                        }
                                        if (UiInterFace.byMaxLoadingNum != 100) {
                                            UiInterFace.byMaxLoadingNum = (byte) 85;
                                        }
                                        MainLogic.getInstance().gamePlayer.bChangeSceneLock = false;
                                        break;
                                }
                            }
                            byImgData = null;
                            SsceneKey = null;
                        }
                        byNetMsgData = null;
                        byIn = null;
                        dIn = null;
                        data = null;
                        cmdIn = null;
                        cmdData = null;
                    }

                } catch (Exception e) {
                    if (Constant.DEBUG) {
                        e.printStackTrace();
                    }
                } finally {
                    this.removeFirstVector();
                    size = this.getVectorNums();
                    iTreadNum++;
                }
            }
        } catch (Exception e) {
            Tools.printLog("网络消息处理异常！");
            // MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "网络消息处理异常", (byte) 0, Constant.GAME_UI_LOGO);
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
        }

    }
//网络消息发送

    public void send(int msgId, byte msgType) {
        //消息体构造发送
        ByteArrayOutputStream byOut = new ByteArrayOutputStream();
        DataOutputStream dOut = new DataOutputStream(byOut);
        byte[] msgData = null;
        try {
            NetManager.iNetMsgSerialNumber += 1;
            dOut.writeInt(NetManager.iNetMsgSerialNumber);
            dOut.writeByte(msgType);
            if (msgType == Constant.SOCKET_MSG_TYPE_HEART) {
                dOut.writeLong(System.currentTimeMillis() + MainLogic.lCSSpaceTime);
            } else {
                dOut.writeInt(msgId);
                switch (msgId) {
                    case Constant.MSG_NET_CMD_SOCKET_START:

                        break;
                    //登录游戏  account (变长) password(变长)
                    case Constant.MSG_NET_CMD_LOGIN:
                        NetManager.blHaveSendLogin = 0;
                        NetManager.blHaveSendStartTime = System.currentTimeMillis();
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_USENAME);
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_PASSWORD);
//                       dOut.write(0x65);
                        Tools.printLog("GameBean.STR_CMD_LOGIN_PASSWORD:" + GameBean.STR_CMD_LOGIN_PASSWORD + "GameBean.STR_CMD_LOGIN_USENAME:" + GameBean.STR_CMD_LOGIN_USENAME);
                        break;
                    //获得角色列表
//                    角色数量(1byte)角色id(8byte)角色等级 (4byte)角色名字(变长)
                    case Constant.MSG_NET_CMD_GET_ROLES:
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_USENAME);
                        break;
                    //发送的具体协议
                    case Constant.MSG_NET_CREATE_ROLE:
                        //创建角色 发送 str 角色名字 性别（byte）	职业(byte)
                        Tools.printLog("MSG_NET_CREATE_ROLE:" + "NetManager.iNetMsgSerialNumber:" + NetManager.iNetMsgSerialNumber);
                        Tools.printLog("角色名称为：" + GameBean.STR_CMD_PLAYER_NICK);
                        //读取用户输入的角色名称
                        dOut.writeUTF(GameBean.STR_CMD_PLAYER_NICK);
                        //性别
                        dOut.writeByte(GameBean.BY_CMD_PLAYER_SEX);
                        //职业
                        dOut.writeByte(GameBean.BY_CMD_PLAYER_JOB);
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_USENAME);
                        break;
                    case Constant.MSG_NET_GET_IMAGE:
//                        Tools.printLog("MSG_NET_GET_IMAGE:" + "NetManager.iNetMsgSerialNumber:" + NetManager.iNetMsgSerialNumber);
                        //获得图片
                        dOut.writeShort(GameBean.SH_RES_PARAMETER_ONE);
                        dOut.writeLong(GameBean.SH_RES_PARAMETER_TWO);
//                        Tools.printLog("GameBean.SH_RES_PARAMETER_ONE" + GameBean.SH_RES_PARAMETER_ONE);
//                        Tools.printLog("GameBean.SH_RES_PARAMETER_TWO" + GameBean.SH_RES_PARAMETER_TWO);
                        String[] strRes = this.getMsgResArray();
                        if (strRes == null || strRes.length == 0) {
                            break;
                        }
                        //图片个数
                        dOut.writeShort(strRes.length);
                        for (int i = 0; i < strRes.length; i++) {
                            //图片的ID
                            dOut.writeInt(Integer.parseInt(strRes[i]));
                            Tools.printLog("申请图片" + strRes[i]);
                            if (Constant.DEBUG) {
                                MainCanvas.addLog("申请图片id:" + strRes[i]);
                            }
                        }
                        setMsgResArray(null);
                        strRes = null;
                        GameBean.SH_RES_PARAMETER_ONE = -1;
                        GameBean.SH_RES_PARAMETER_TWO = -1;
                        break;
                    case Constant.MSG_NET_GET_ANIMATION:
                        Tools.printLog("MSG_NET_GET_ANIMATION" + "NetManager.iNetMsgSerialNumber" + NetManager.iNetMsgSerialNumber);
                        //fixed
//                    if(GameBean.SH_FIXE1 != -1)
//                        dOut.writeShort(Constant.MSG_NET_GET_NPCS);
//                    else
                        dOut.writeShort(GameBean.SH_RES_PARAMETER_ONE);
                        dOut.writeUTF(String.valueOf(GameBean.SH_RES_PARAMETER_TWO));
                        strRes = this.getMsgResArray();
                        if (strRes == null || strRes.length == 0) {
                            break;
                        }
                        int num = 0;
                        for (int i = 0; i < strRes.length; i++) {
                            //图片的ID
                            if (strRes[i] == null) {
                                num += 1;
                            }
                        }
                        //动画个数
                        dOut.writeShort(strRes.length - num);
                        for (int i = 0; i < strRes.length; i++) {
                            //图片的ID
                            if (strRes[i] != null) {
                                dOut.writeInt(Integer.parseInt(strRes[i]));
                            }
                            if (Constant.DEBUG) {
                                MainCanvas.addLog("请求aniid:" + strRes[i]);
                            }
                            Tools.printLog("MSG_NET_GET_ANIMATION" + strRes[i]);
                        }
                        setMsgResArray(null);
                        strRes = null;
                        GameBean.SH_RES_PARAMETER_ONE = -1;
                        GameBean.SH_RES_PARAMETER_TWO = -1;
                        break;
                    case Constant.MSG_NET_GET_TERRAIN:
                        //fixed
//                        dOut.writeShort(msgId);
//                        dOut.writeLong(this.getResCode());
                        //#if NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
//#                         //地图数据个数
//#                         dOut.writeByte(1);
                        //#else
                        dOut.writeByte(0);
                        //#endif
//                          dOut.writeByte(0);
                        //地图的ID
                        dOut.writeInt(this.getTerrainId());
//                        System.out.println("this.getTerrainId()" + this.getTerrainId());
                        break;
                    case Constant.MSG_NET_ENTER_WORLD:
                        Tools.printLog("GameBean.STR_CMD_LOGIN_USENAME:" + GameBean.STR_CMD_LOGIN_USENAME
                                + "NetManager.GameBean.L_CMD_PLAYER_OWN_ID:" + GameBean.L_CMD_PLAYER_OWN_ID
                                + "NetManager.GameBean.L_CMD_PLAYER_OWN_LEVLE:" + GameBean.L_CMD_PLAYER_OWN_LEVLE
                                + "NetManager.GameBean.L_CMD_PLAYER_OWN_SEX:" + GameBean.L_CMD_PLAYER_OWN_SEX);
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_USENAME);
                        dOut.writeLong(GameBean.L_CMD_PLAYER_OWN_ID);
                        dOut.writeInt(GameBean.L_CMD_PLAYER_OWN_LEVLE);
                        dOut.writeByte(GameBean.L_CMD_PLAYER_OWN_SEX);
                        break;
                    case Constant.MSG_NET_BATTLE:
//                        if (MainLogic.getInstance().iLockedObjNumber[0][0] == -1) {
//                            return;
//                        }
                        //发起人角色ID
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        Tools.printLog("发送时发起方ID：" + MainLogic.getInstance().gamePlayer.lPlayerID);
                        if (MainLogic.getInstance().iLockedObjNumber[0][0] != -1) //目标角色ID
                        {
                            dOut.writeLong(MainLogic.getInstance().iLockedObjNumber[0][0]);
                            Tools.printLog("发送时目标方ID：" + MainLogic.getInstance().iLockedObjNumber[0][0]);
                        } else {
                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                            Tools.printLog("发送时目标方ID：" + MainLogic.getInstance().gamePlayer.lPlayerID);
                        }
                        //Tools.printLog("MainLogic.getInstance().iPlayerID"+MainLogic.getInstance().iPlayerID);
                        // Tools.printLog("MainLogic.getInstance().iLockedObjNumber[0][0]"+MainLogic.getInstance().iLockedObjNumber[0][0]);
                        //地图的ID
//                    Tools.printLog("MainLogic.strPlayerSkill[MainLogic.getInstance().gamePlayer.skillPlayer.getSkillActionId()]" + SkillManager.strPlayerSkill[MainLogic.getInstance().gamePlayer.skillPlayer.getSkillActionId()]);
                        Tools.printLog("发送战斗指令：" + MainLogic.getInstance().gamePlayer.skillPlayer.getSkillActionKey());
                        dOut.writeUTF(MainLogic.getInstance().gamePlayer.skillPlayer.getSkillActionKey());
                        break;
//Player_ID(8byte)	Position X (4byte)	Position Y(4byte)	方向x(4byte)	方向y(4byte)	Type(byte)	发送的时间间隔ms(4byte)
                    case Constant.MSG_NET_WALK:
                        if (!MainLogic.blLogined) {
                            break;
                        }
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeInt(MainLogic.getInstance().gamePlayer.iPlayerX);
                        dOut.writeInt(MainLogic.getInstance().gamePlayer.iPlayerY);
                        int direct = 0;
                        dOut.writeByte(Tools.getClientDirection(MainLogic.getInstance().gamePlayer.byPlayerDirection));
                        if (MainLogic.getInstance().gamePlayer.byPlayerState == Constant.PLAYER_STATE_AUTO_RUN) {
                            dOut.writeByte(1);
                            Tools.printLog("寻路走路.blStartWalk" + 1);
                        } else {
                            dOut.writeByte(Player.blStartWalk ? 1 : 0);
                            Tools.printLog("走路Player.blStartWalk" + Player.blStartWalk);
                        }
                        //时间;
                        int temptime = (int) (System.currentTimeMillis() - Constant.PLAYER_WALK_TEST_DELAY);
                        if (temptime > 250 || temptime < 0) {
                            temptime = 80;
                        }
                        dOut.writeInt(temptime);
                        Constant.PLAYER_WALK_TEST_DELAY = System.currentTimeMillis();
                        break;
                    case Constant.MSG_NET_LEARN_SKILL:
                        //000101
//                        Tools.printLog("技能角色ID" + MainLogic.getInstance().gamePlayer.lPlayerID);
//                        Tools.printLog("技能计数：" + MainLogic.getInstance().iCount);
//                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
//                        if (MainLogic.getInstance().iCount > MainLogic.getInstance().sSkillArray.length - 1) {
//                            MainLogic.getInstance().iCount = 0;
//                        }
//                        dOut.writeUTF(MainLogic.getInstance().sSkillArray[MainLogic.getInstance().iCount]);
//                        Tools.printLog("技能ID：" + MainLogic.getInstance().sSkillArray[MainLogic.getInstance().iCount]);
                        break;
                    case Constant.MSG_NET_ADD_SKILL_PLACE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeShort((short) 1);
                        break;
                    case Constant.MSG_NET_UNLEARN_SKILL:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.kungfuKey[MainLogic.getInstance().uiEquipment.delkungfu_id]);

//                        if (MainLogic.getInstance().iCount2 > MainLogic.getInstance().sSkillArray.length - 1) {
//                            MainLogic.getInstance().iCount2 = 0;
//                        }
//                        if (MainLogic.getInstance().sLearnedSkill[MainLogic.getInstance().iCount2] != null) {
//                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
//                            Tools.printLog("技能ID：" + MainLogic.getInstance().sLearnedSkill[MainLogic.getInstance().iCount2]);
//                            dOut.writeUTF(MainLogic.sLearnedSkill[MainLogic.getInstance().iCount2]);
//                        } else {
//                            Tools.printLog("没有学习这个技能");
//                        }
                        break;
                    case Constant.MSG_NET_CLEAN_MERIDIAN:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    //npc交流命令
                    case Constant.MSG_NET_CMD_NPC:
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("发送打开npcd对界面");
                        }
                        dOut.writeLong(MainLogic.gamePlayer.lPlayerID);
                        if (MainLogic.getInstance().iLockedObjNumber[0][0] != -1) //目标角色ID
                        {
                            dOut.writeLong(MainLogic.getInstance().iLockedObjNumber[0][0]);
                        }

                        break;
                    //npc 任务指令
                    case Constant.MSG_NET_CMD_QUEST:
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("发送任务请求");
                        }
                        dOut.writeShort(GameBean.SH_CMD_QUEST);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeUTF(GameBean.STR_CMD_QUEST_KEY);
                        //新手接受任务标记用于判断是否接受任务，绝对是否让其过区
                        if (GameBean.STR_CMD_QUEST_KEY.equals("1145")) {
                            GameBean.BL_NEWPLAYER_CAN_GO_LOCK = false;
                            Rms.saveGame(Constant.RMS_NEW_PLAYER_CAN_GO_LOCK, null);
                        }
                        if (GameBean.SH_CMD_QUEST == 3) {
                            dOut.writeShort(GameBean.BY_GOODS_NUM);
                            if (GameBean.BY_GOODS_NUM > 0) {
                                if (GameBean.BY_TYPE == 2) {
                                    if (GameBean.BY_GOODS_NUM > 0) {
                                        for (short i = 0; i < GameBean.BY_GOODS_NUM; i++) {
                                            dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY_ARRAY[i]);
                                        }
                                    }
                                } else if (GameBean.BY_TYPE == 1) {
                                    dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                                }
                            }
                        }
                        GameBean.SH_CMD_QUEST = -1;
                        GameBean.STR_CDM_GOODS_KEY_ARRAY = null;
                        break;
                    //打开包裹栏
                    case Constant.MSG_NET_CMD_OPEN_BAG:
                    //排序物品
                    case Constant.MSG_NET_CMD_SORT_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_OPEN_EQUIP:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    //添加物品
                    case Constant.MSG_NET_CMD_ADD_ITEM:
                        break;
                    //删除物品
                    case Constant.MSG_NET_CMD_DELETE_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    //查看物品
                    case Constant.MSG_NET_CMD_CHECK_ITEM:
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeByte(GameBean.BY_CMD_COLUMN_TYPE);
                        if (GameBean.BY_CMD_COLUMN_TYPE == 1) {
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        } else if (GameBean.BY_CMD_COLUMN_TYPE == 2) {
                            dOut.writeByte(GameBean.BY_CMD_EQUIP_PLACE);
                        } else if (GameBean.BY_CMD_COLUMN_TYPE == 3) {
                            dOut.writeByte((byte) GameBean.I_CMD_COLUMN_INDEX);
                        }
                        Tools.printLog(GameBean.BY_CMD_COLUMN_TYPE + "+" + GameBean.L_CMD_GOODS_SLOTKEY + "+" + GameBean.BY_CMD_EQUIP_PLACE);
                        break;
                    //装备物品
                    case Constant.MSG_NET_CMD_USE_EQUIP:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        switch (MainLogic.getInstance().byGameState) {
                            case Constant.GAME_UI_EQUIPMENT:
                                //装备栏
                                dOut.writeByte((byte) 1);
                                dOut.writeInt(GameBean.I_CMD_COLUMN_INDEX);
                                break;
                            case Constant.GAME_UI_PACKAGE:
                                //普通物品栏
                                dOut.writeByte((byte) 0);
                                dOut.writeInt(0);
                                break;
                        }
                        break;
                    case Constant.MSG_NET_CMD_DELETE_EQUIP:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_CMD_EQUIP_PLACE);
                        break;
                    case Constant.MSG_NET_CMD_CHECK_DESC:
                        dOut.writeLong(GameBean.L_CMD_DESC_GOODS_KEY);
                        break;
                    case Constant.MSG_NET_CMDSYN_TIME:
                        long temptimea = (long) (System.currentTimeMillis() - MainLogic.lCSSpaceTime);
                        if (temptimea > 250 || temptimea < 0) {
                            temptimea = 80;
                        }
                        dOut.writeLong(temptimea);
                        break;
                    case Constant.MSG_NET_DIFF_EQUIP:
                        //对比装备
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_USE_ITEM:
                        //使用物品
                        if (MainLogic.getInstance().gamePlayer.blCanUseGoods) {
                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                            dOut.writeByte(GameBean.BY_CMD_COLUMN_TYPE);
                        } else {
                            MainLogic.uiInterFace.sysMessage.showMessage("提示", "混乱状态下不能使用物品！");
                        }
                        break;
                    case Constant.MSG_NET_CMD_FIND_PATH:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.BY_CMD_PLAYER_AUTORUN_CUR_SENCE);
                        dOut.writeUTF(GameBean.BY_CMD_PLAYER_AUTORUN_OBJ_SENCE);
                        GameBean.BY_CMD_PLAYER_AUTORUN_CUR_SENCE = null;
                        GameBean.BY_CMD_PLAYER_AUTORUN_OBJ_SENCE = null;
                        break;
                    case Constant.MSG_NET_CMD_TEAM_JOIN:
                        //发起人ID
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        //邀请人ID
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_TEAM_ANSWER:
                        //发起人ID
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        //应答人iD
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        //result
                        dOut.writeByte(GameBean.BY_APPLY_RESULT);
                        break;
                    //心法
                    case Constant.MSG_NET_OPEN_KUNGFU:
                        //发起人ID
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CHECK_SKILL:
                        if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_GAMESET_QUICKEYS) {
                            dOut.writeUTF(MainLogic.getInstance().uiInterFace.gameSet.getsetSkillKey);
                        } else if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_SKILL) {
                            dOut.writeUTF(MainLogic.getInstance().uiEquipment.strSkillKey);
                        }
                        break;
                    case Constant.MSG_NET_CMD_SET_FLOW:
                        //发起人ID
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        //流量
                        dOut.writeByte((byte) (MainLogic.uiEquipment.flow + 1));
//                        System.out.println("flow33   " + (MainLogic.uiEquipment.flow + 1));
                        break;
                    case Constant.MSG_NET_CMD_CMD_NOTICE:
                        //notice
                        dOut.writeLong(MainLogic.getInstance().uiEquipment.Noticeid);
                        break;
                    case Constant.MSG_NET_CMD_NOTICE_LIST:
                        dOut.writeByte((byte) 1);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_MAIL_HINT: //信件提示

                        break;
                    case Constant.MSG_NET_CMD_MAIL_CHECKUSER://判断收件人是否存在
                        //
                        dOut.writeByte((byte) 1);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.sendEmail_name);
//                        System.out.println("判断收件人姓名：：" + MainLogic.getInstance().uiEquipment.sendEmail_name);
                        break;
                    case Constant.MSG_NET_CMD_MAIL_POST://发送邮件
                        //
                        dOut.writeByte(Constant.CMD_MAIL_TYPE);//邮件类型
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                        if (Constant.CMD_MAIL_TYPE == 0) {
                            if (MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum() > 0) {
                                dOut.writeLong(MainLogic.getInstance().uiEquipment.sendEmail_money);//邮费
                                Tools.printLog("邮费 ::" + MainLogic.getInstance().uiEquipment.sendEmail_money);
                            } else {
                                dOut.writeLong((byte) 0);//邮费
                            }
                        }

                        dOut.writeByte((byte) 0);//过期处理
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.sendEmail_title);//标题
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.sendEmail_text);//内容
                        long menoy_send;
                        if (Constant.CMD_MAIL_TYPE == 0) {
                            menoy_send = MainLogic.getInstance().uiEquipment.money_gold * 10000
                                    + MainLogic.getInstance().uiEquipment.money_silver * 100
                                    + MainLogic.getInstance().uiEquipment.money_copper;
                            dOut.writeLong(menoy_send);//赠送钱
                            if (MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum() > 0) {
                                dOut.writeByte((byte) MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum());//有无附件
                                for (int c = 0; c < MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum(); c++) {
                                    dOut.writeLong(MainLogic.getInstance().uiEquipment.emailItems.getGoodsColumnKey((short) c));//附件
                                    Tools.printLog("附件:: " + c + "  ::  " + MainLogic.getInstance().uiEquipment.emailItems.getGoodsColumnKey((short) c));
                                }
                            } else {
                                dOut.writeByte((byte) 0);//有无附件
                            }
                            dOut.writeUTF(MainLogic.getInstance().uiEquipment.sendEmail_name);//收件人姓名
                        }
                        break;
                    case Constant.MSG_NET_CMD_MAIL_OPEARTION://邮件操作
                        dOut.writeByte((byte) 1);
                        switch (MainLogic.getInstance().uiEquipment.Opeartion_type) {
                            case 0://打开邮件
                                dOut.writeByte((byte) 0);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));//Mail_id
                                break;
                            case 1://收取附件
                                dOut.writeByte((byte) 1);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));//Mail_id
                                break;
                            case 2://锁定
                                dOut.writeByte((byte) 2);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));//Mail_id
                                break;
                            case 3://解锁
//                                System.out.println("33333333333");
                                dOut.writeByte((byte) 3);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));//Mail_id
//                                System.out.println("id33  " + Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));
                                break;
                            case 4://删除
//                                System.out.println("44444444");
                                dOut.writeByte((byte) 4);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));//Mail_id
//                                System.out.println("id44  " + Long.parseLong(MainLogic.getInstance().uiEquipment.ReceiveEmail[MainLogic.getInstance().uiEquipment.operationmail_index][4]));
                                break;
                            case 5://清空收件箱
                                dOut.writeByte((byte) 5);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(0);//Mail_id
                                break;
                            case 6://清除所有已读邮件
                                dOut.writeByte((byte) 6);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(0);//Mail_id
                                break;
                            case 7://查看邮件列表
                                dOut.writeByte((byte) 7);//Operaion_type
                                dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);//发件人
                                dOut.writeLong(0);//Mail_id
                                break;
                        }
                        break;
                    case Constant.MSG_NET_CMD_MAIL_MONEY://查询邮寄金钱
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        menoy_send = MainLogic.getInstance().uiEquipment.money_gold * 10000
                                + MainLogic.getInstance().uiEquipment.money_silver * 100
                                + MainLogic.getInstance().uiEquipment.money_copper;
                        dOut.writeLong(menoy_send);//赠送钱
                        dOut.writeByte((byte) MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum());//有无附件
                        for (int c = 0; c < MainLogic.getInstance().uiEquipment.emailItems.getGoodsNum(); c++) {
                            dOut.writeLong(MainLogic.getInstance().uiEquipment.emailItems.getGoodsColumnKey((short) c));//附件
                        }
                        break;
                    case Constant.MSG_NET_CMD_CHECK_MONEY://查询金钱
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_OPEN_MERIDIAN:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(MainLogic.getInstance().uiEquipment.meridianschoose_index);
                        break;
                    case Constant.MSG_NET_CMD_SET_QUICK:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        int setnum = 0;
                        for (int c = 0; c < 9; c++) {
                            if (MainLogic.getInstance().uiInterFace.gameSet.QuickSet[c][0] != null) {
                                setnum += 1;
                            }
                        }
                        dOut.writeByte(setnum);
                        for (int d = 0; d < 9; d++) {
                            if (MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][0] != null) {
                                dOut.writeByte(d);
                                dOut.writeByte(Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][1]));
                                if (Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][1]) == 1) {//技能
                                    dOut.writeUTF(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][3]);
                                } else if (Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][1]) == 2) {//物品
                                    dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][3]));
                                } else if (Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][1]) == 3) {//功能
                                    dOut.writeByte((Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][3]) + 1));
//                                    System.out.println("xx  " + (Byte.parseByte(MainLogic.getInstance().uiInterFace.gameSet.QuickSet[d][3]) + 1));
                                }
                            }
                        }
                        break;
                    case Constant.MSG_NET_GET_MERIDIAN_DESC:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.getMeridiansKey);//
                        break;
                    case Constant.MSG_NET_LEARN_MERIDIAN:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(MainLogic.getInstance().uiEquipment.getMeridiansKey);//
//                        System.out.println("学习经脉上行：" + MainLogic.getInstance().uiEquipment.getMeridiansKey);
                        break;
                    case Constant.MSG_NET_CMD_SHOUT:
                        //发起人ID
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        switch (MainLogic.getInstance().uiEquipment.chatshoutType) {
                            case 0://综合
                                //喊话类型
                                dOut.writeByte(2);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                            case 1://世界
                                //喊话类型
                                dOut.writeByte(1);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                            case 2://当前
                                //喊话类型
                                dOut.writeByte(2);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                            case 3://私聊
                                //喊话类型
                                dOut.writeByte(6);
                                //对方ID
                                if (UiEquipment.chatindex == 0) {
                                    dOut.writeLong(UiEquipment.chatOtherplayerId);
                                } else {
                                    switch (MainLogic.getInstance().uiEquipment.chatSelectindex) {//
                                        case 0://综合chatStrArray
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.sendchatindex - (MainLogic.getInstance().uiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 1://世界 chatStrArray_world
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[MainLogic.getInstance().uiEquipment.sendchatindex - (MainLogic.getInstance().uiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 2://当前 chatStrArray_current
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[UiEquipment.sendchatindex - (UiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 3://私聊 chatStrArray_Private
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[UiEquipment.sendchatindex - (UiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 4://队伍 chatStrArray_team
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[UiEquipment.sendchatindex - (UiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 5://帮派 chatStrArray_gang
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[MainLogic.getInstance().uiEquipment.sendchatindex - (MainLogic.getInstance().uiEquipment.chatindex - 1)][4]));
                                            break;
                                        case 6://系统 chatStrArray_system
                                            dOut.writeLong(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[MainLogic.getInstance().uiEquipment.sendchatindex - (MainLogic.getInstance().uiEquipment.chatindex - 1)][4]));
                                            break;
                                    }
                                }
                                break;
                            case 4://队伍
                                //喊话类型
                                dOut.writeByte(3);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                            case 5://帮派
                                //喊话类型
                                dOut.writeByte(4);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                            case 6://系统
                                //喊话类型
                                dOut.writeByte(5);
                                //对方ID
                                dOut.writeLong(0);
                                break;
                        }

                        //喊话内容
                        String newStr = MainLogic.getInstance().uiEquipment.sStrArray[0];
                        if (newStr.indexOf("/%") != -1) {
                            newStr = newStr.substring(0, newStr.indexOf("/%") + 2)
                                    + MainLogic.getInstance().uiEquipment.taskORitems_new
                                    + newStr.substring(newStr.indexOf("/%") + 2, newStr.length());
                            MainLogic.getInstance().uiEquipment.oldtaskORitems_new = MainLogic.getInstance().uiEquipment.taskORitems_new;
                        }
                        dOut.writeUTF(newStr);
//                        System.out.println("222222222222222222222222");
//                        Tools.printLog("newStr11  ::: " + newStr);
//                        if (UiEquipment.chatindex > 0) {
//                            Tools.printLog("UiEquipment.chatindex ::" + UiEquipment.chatindex);
//                            Tools.printLog("UiEquipment.chatStrArray[UiEquipment.chatindex-1][4] :::" + UiEquipment.chatStrArray[UiEquipment.sendchatindex-(UiEquipment.chatindex - 1)][4]);
//                            if (UiEquipment.chatStrArray[UiEquipment.sendchatindex-(UiEquipment.chatindex - 1)][4] != null) {
//                                Tools.printLog("UiEquipment.chatStrArray[UiEquipment.chatindex][4]  ::: "
//                                        + Long.parseLong(UiEquipment.chatStrArray[UiEquipment.sendchatindex-(UiEquipment.chatindex - 1)][4]));
//                            }
//                        }
                        break;
                    case Constant.MSG_NET_BUFF_OPT:
                        if (MainLogic.getInstance().iLockedObjNumber[0][0] != -1) //目标角色ID
                        {
                            dOut.writeLong(MainLogic.iLockedObjNumber[0][0]);
                        }

                        break;
                    case Constant.MSG_NET_CMD_DELETE_BUFF:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_BUFFER_ID);
                        break;
                    case Constant.MSG_NET_CMD_QUEST_LIST://任务列表界面
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_TONG_TRANS://帮派传送
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_TONG_ID);
                        GameBean.L_CMD_TONG_ID = -1;
                        break;
                    case Constant.MSG_NET_CMD_TEAM_DISMISS:
                        //解散队伍
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_TEAM_LEAVE:
                        //离开队伍
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_TEAM_CHANGE_LEADER:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_COMPOSE:
                        //装备合成
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_GOODS_NUM);
                        for (byte i = 0; i < GameBean.BY_GOODS_NUM; i++) {
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOCKEY_ARRAY[i]);
                        }
                        GameBean.L_CMD_GOODS_SLOCKEY_ARRAY = null;
                        break;
                    case Constant.MSG_NET_CMD_FUNC_DECOMPOSE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_COMPOSE_MONEY:
                        //查询装备合成所需money
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_GOODS_NUM);
                        for (byte i = 0; i < GameBean.BY_GOODS_NUM; i++) {
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOCKEY_ARRAY[i]);
                        }
                        GameBean.L_CMD_GOODS_SLOCKEY_ARRAY = null;
                        break;
                    case Constant.MSG_NET_CMD_FUNC_DECOMPOSE_MONEY:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_QUEST_INFO:
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeUTF(GameBean.STR_CMD_QUEST_KEY);
                        break;
                    case Constant.MSG_NET_QUIT_GAME://退出游戏
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CREATE_TONG:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_TONG_NAME);
                        dOut.writeUTF(GameBean.STR_CMD_TONG_NO);
                        dOut.writeUTF(GameBean.STR_CMD_TONG_ADS);
                        break;
                    case Constant.MSG_NET_CMD_APPLICATION_TONG:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_TONG_ID);
                        break;
                    case Constant.MSG_NET_CMD_TONG_LEAVE: //离开帮派
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_TONG_CHANGE_DESCRIPT://修改公告
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_TONG_ADS);
                        break;
                    case Constant.MSG_NET_TONG_NPC_UPGRADE://帮派NPC建筑升级
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_CMD_TONG_BUILDING_TYPE);
                        GameBean.BY_CMD_TONG_BUILDING_TYPE = -1;
                        break;
                    case Constant.MSG_NET_TONG_NPC_INFO://帮派NPC等级
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_TONG_DESCRIPT:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_TONG_ID);
                        break;
                    //解散帮派
                    case Constant.MSG_NET_CMD_TONG_DISMISS:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    //帮助让位
                    case Constant.MSG_NET_CMD_TONG_CHANGE_POSITION:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeByte(GameBean.B_CMD_TONG_DUTY);
                        break;
                    case Constant.MSG_NET_CMD_TONG_LIST:
                        break;
                    case Constant.MSG_NET_CMD_TONG_MEMBER_LIST:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_INVITE_TONG:
                        if (GameBean.BY_CMD_INVITE_TONG_TYPE == 1) {
                            dOut.writeByte(GameBean.BY_CMD_INVITE_TONG_TYPE);
                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                            dOut.writeLong(GameBean.L_PLAYER_ID);
                            GameBean.BY_CMD_INVITE_TONG_TYPE = -1;
                        } else if (GameBean.BY_CMD_INVITE_TONG_TYPE == 2) {
                            dOut.writeByte(GameBean.BY_CMD_INVITE_TONG_TYPE);
                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                            dOut.writeLong(GameBean.L_PLAYER_ID);
                            dOut.writeByte(GameBean.BY_CMD_JION_TONG_CONFERM);
                            GameBean.BY_CMD_INVITE_TONG_TYPE = -1;
                            GameBean.BY_CMD_JION_TONG_CONFERM = -1;
                        }
                        break;
                    case Constant.MSG_NET_CMD_OPEN_PET:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_DELETE_PET:
                        //卸载宠物
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_PET_FEED:
                        //宠物喂养
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_USE_PET:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeInt(GameBean.I_CMD_COLUMN_INDEX);
                        break;
                    case Constant.MSG_NET_CMD_CHECK_PET:
                        //查看宠物
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_PETSTRENGTH:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_PET_COMPOSE:
                        //宠物合成
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_SELECT_PETSTRENGTH_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_SELECT_PETCOMPOSE_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_NPC_INFO:
                    case Constant.MSG_NET_CMD_OTHER_PLAYER_INFO:
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_MOVE_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeInt(GameBean.I_CMD_COLUMN_INDEX);
                        dOut.writeShort(GameBean.BY_GOODS_NUM);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_HOLE:
                        //打孔
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_INLAY:
                        //镶嵌
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeLong(GameBean.l_CMD_GOODS_SLOTKEY_SECOND);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_HOLE_MONEY:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_INLAY_MONEY:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeLong(GameBean.l_CMD_GOODS_SLOTKEY_SECOND);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STRENGTH:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeLong(GameBean.l_CMD_GOODS_SLOTKEY_SECOND);
                        if (GameBean.BY_GOODS_NUM > 0) {
                            dOut.writeByte(GameBean.BY_GOODS_NUM);
                            for (byte i = 0; i < GameBean.BY_GOODS_NUM; i++) {
                                dOut.writeLong(GameBean.L_CMD_GOODS_SLOCKEY_ARRAY[i]);
                            }
                        } else {
                            dOut.writeByte(0);
                        }
                        GameBean.L_CMD_GOODS_SLOCKEY_ARRAY = null;
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STRENGTH_MONEY:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STRENGTH_RATE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_ADD_FRIEND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.BY_CMD_FRIEND_NAME);
                        dOut.writeInt(GameBean.BY_CMD_FRIEND_TYPE);
                        dOut.writeByte(GameBean.BY_CMD_FRIEND_MODE);
                        GameBean.BY_CMD_FRIEND_MODE = -1;
                        break;
                    case Constant.MSG_NET_CMD_FRIEND_LIST:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeInt(GameBean.BY_CMD_FRIEND_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_DEL_FREIND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.BY_CMD_FRIEND_ID);
                        dOut.writeInt(GameBean.BY_CMD_FRIEND_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_ADD_CONTANT:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.BY_CMD_FRIEND_ID);
                        break;
                    case Constant.MSG_NET_CMD_OPEN_NPC_STORE:
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_OP_TYPE);
//                        System.out.println("GameBean.L_NPC_ID11  " + GameBean.L_NPC_ID);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STORE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeByte(GameBean.BY_TYPE);
//                        System.out.println("GameBean.L_NPC_ID  " + GameBean.L_NPC_ID);
//                        System.out.println("GameBean.BY_TYPE  " + GameBean.BY_TYPE);
                        if (GameBean.BY_TYPE == 1) {//购买
                            dOut.writeByte(GameBean.BY_OP_TYPE);//商店的类型
                            dOut.writeLong(0);
                            dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                            dOut.writeByte(GameBean.BY_GOODS_NUM);
//                            System.out.println("GameBean.BY_GOODS_NUM  " + GameBean.BY_GOODS_NUM);
                            if (GameBean.BY_OP_TYPE == 4
                                    || GameBean.BY_OP_TYPE == 5
                                    || GameBean.BY_OP_TYPE == 6) {
                                dOut.writeShort(Short.parseShort(MainLogic.getInstance().uiEquipment.Exchange[MainLogic.getInstance().uiEquipment.Exchange_index][3]));
//                                System.out.println("Exchange_index][3]  " + MainLogic.getInstance().uiEquipment.Exchange[MainLogic.getInstance().uiEquipment.Exchange_index][3]);
                            }
                        } else if (GameBean.BY_TYPE == 2) {//出售
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                            dOut.writeUTF("");
                        }
//                            else if (GameBean.BY_TYPE == 4
//                                || GameBean.BY_TYPE == 5
//                                || GameBean.BY_TYPE == 6) {
//                            dOut.writeByte(1);
//                            dOut.writeLong(0);
//                            dOut.writeUTF(MainLogic.getInstance().uiEquipment.Exchange[MainLogic.getInstance().uiEquipment.Exchange_index][1]);
//                            System.out.println("Exchange_index][1]  " + MainLogic.getInstance().uiEquipment.Exchange[MainLogic.getInstance().uiEquipment.Exchange_index][1]);
//                            dOut.writeByte(MainLogic.getInstance().uiEquipment.Exchange_num);
//                            System.out.println("MainLogic.getInstance().uiEquipment.Exchange_num  " + MainLogic.getInstance().uiEquipment.Exchange_num);
//
//                        }
                        GameBean.STR_CDM_GOODS_KEY = null;
                        break;
                    case Constant.MSG_NET_CMD_CHECK_STORE_ITEM:
                        dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                        GameBean.STR_CDM_GOODS_KEY = null;
                        break;
                    case Constant.MSG_NET_CMD_CHECK_STORE_DESC:
                        dOut.writeUTF(GameBean.STR_DESC_CDM_GOODS_KEY);
                        GameBean.STR_DESC_CDM_GOODS_KEY = null;
                        break;
                    case Constant.MSG_NET_CMD_OPEN_DEPOT:
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_DEPOT:
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        if (GameBean.BY_TYPE == 3) {
                            dOut.writeLong(0);
                        } else {
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        }
                        break;
                    case Constant.MSG_NET_CMD_TRADE_JOIN:
                        //发起人
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        //目标人
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        //类型(1,交易,2,切磋)
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_TRADE_ANSWER:
                        //发起人
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        //目标人
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_APPLY_RESULT);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_TRADE_CANCEL:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        //取消交易
                        break;
                    case Constant.MSG_NET_CMD_SYNC_TRADE_ITEM:
                        //同步交易信息
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeByte(GameBean.BY_OP_TYPE);
                        if (GameBean.BY_TYPE == 1) {
                            //选择东西
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                            dOut.writeInt(0);
                        } else if (GameBean.BY_TYPE == 2) {
                            //选择金钱
                            dOut.writeLong(0);
                            dOut.writeInt(GameBean.I_MONEY);
                        }

                        break;
                    case Constant.MSG_NET_CMD_TRADE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeShort(GameBean.BY_GOODS_NUM);
                        for (byte i = 0; i < GameBean.BY_GOODS_NUM; i++) {
                            dOut.writeLong(GameBean.L_CMD_GOODS_SLOCKEY_ARRAY[i]);
                        }
                        //交易
                        dOut.writeInt(GameBean.I_MONEY);
                        GameBean.L_CMD_GOODS_SLOCKEY_ARRAY = null;
                        break;
                    case Constant.MSG_NET_CMD_LOCK_TRADE:
                        //锁定交易
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_IDEAD:
                        dOut.writeByte(GameBean.BY_CMD_REVIVE_TYPE);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_ADD_ATTR_POINT:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        for (int i = 0; i < MainLogic.getInstance().uiInterFace.property.addData.length; i++) {
                            dOut.writeInt(MainLogic.getInstance().uiInterFace.property.addData[i]);
                        }
                        break;
                    case Constant.MSG_NET_CMD_GET_SERIES_INFO:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_PK:
//                        Tools.printLog("当前PK状态值：" + MainLogic.getInstance().gamePlayer.bPkState);
                        if (MainLogic.getInstance().gamePlayer.bPkState == 0) {//开启PK状态
                            dOut.writeByte((byte) 1);
                        } else {//关闭PK状态
                            dOut.writeByte((byte) 0);
                        }
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_SOCIAL:
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_GET_REPAIR_FEE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeShort(GameBean.SH_MIN_PET_REPAIR_LEVLE);
                        dOut.writeShort(GameBean.SH_MAX_PET_REPAIR_LEVLE);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_REPAIR:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_PET_LOCK_SKILL:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeByte((byte) GameBean.I_CMD_COLUMN_INDEX);
                        break;
                    case Constant.MSG_NET_CMD_PET_BIND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_HOLE_INFO:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_DISMANTLE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_OP_TYPE);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                        GameBean.STR_CDM_GOODS_KEY = null;
                        break;
                    case Constant.MSG_NET_CMD_OPT_ON_SCREEN:
                        MainLogic.getInstance().bSendOnScreen = true;
                        dOut.writeByte(GameBean.SCREEN_TYPE);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        if (Constant.DEBUG) {
                            MainCanvas.addLog("发送请求npc");
                            MainCanvas.addLog("ROLEID:" + MainLogic.getInstance().gamePlayer.lPlayerID);
                        }
                        break;
                    case Constant.MSG_NET_CMD_TEAM_ROLL:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_APPLY_RESULT);
                        break;
                    case Constant.MSG_NET_CMD_APPLY_TONG_ARENA:
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_SEND_TONG_ARENA:
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_DELETE_QUEST:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_QUEST_KEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_SEND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_SCENCE_KEY);
                        dOut.writeInt(GameBean.i_SEND_POS_X);
                        dOut.writeInt(GameBean.i_SEND_POS_Y);
                        GameBean.STR_SCENCE_KEY = null;
                        break;
                    case Constant.MSG_NET_CMD_PET_CHANGE_ALIAS:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeUTF(GameBean.STR_CMD_GOODS_NAME);
                        break;
                    case Constant.MSG_NET_CMD_PET_DEFEND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_OP_TYPE);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_CHECK_NEAR_PLAYERS:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_OTHER_PLAYER_DETAIL:
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_SELECT_PET_POTENTIAL_ITEM:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_PET_FUNC_POTENTIAL_EXCITE:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_PET_EQUIP_USE:
                        //宠物使用物品
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_PET_SLOTKEY);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        break;
                    case Constant.MSG_NET_CMD_GET_SEND_POINT:
                        dOut.writeLong(GameBean.L_NPC_ID);
                        break;
                    case Constant.MSG_NET_CMD_EQUIP_BIND:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeLong(GameBean.L_BIND_SIGN_KEY);
                        break;
                    case Constant.MSG_NET_CMD_GET_APPLY_TONG_LIST:
                        dOut.writeByte(GameBean.BY_CMD_APPLY_FIGHT_TYPE);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_QUEST_SIMPLE_INFO:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_QUEST_KEY);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_QUESTION_INFO:
                        dOut.writeByte(GameBean.BY_QUESTION);
                        if (GameBean.BY_QUESTION == 2) {
                            dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        }
                        break;
                    case Constant.MSG_NET_CMD_QUESTION_RUN:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte((byte) (MainLogic.getInstance().uiInterFace.byIndex[MainLogic.getInstance().uiInterFace.iSelectIndex - 1] + 1));
                        break;
                    case Constant.MSG_NET_CMD_QUESTION_END:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_OPEN_INGOT_STORE:
                        Tools.printLog("发送打开元宝商店信息");
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeByte(GameBean.BY_OP_TYPE);
                        dOut.writeByte(GameBean.BY_TRUE);
                        Tools.printLog("GameBean.BY_TYPE:" + GameBean.BY_TYPE + "GameBean.BY_OP_TYPE:" + GameBean.BY_OP_TYPE + "GameBean.BY_TRUE:" + GameBean.BY_TRUE);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_INGOT_BUY:
                        //购买元宝商城东西
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                        dOut.writeByte(GameBean.BY_GOODS_NUM);
                        break;
                    case Constant.MSG_NET_CMD_MY_INGOT_RECORD:
                        //我的收藏和购买记录
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STORE_ITEM_COLLECT:
                        //收藏和取消收藏
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                        break;
                    case Constant.MSG_NET_CMD_FUNC_STORE_GIFT:
                        //赠送
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeUTF(GameBean.STR_CDM_GOODS_KEY);
                        dOut.writeByte(GameBean.BY_GOODS_NUM);
                        dOut.writeUTF(GameBean.BY_CMD_FRIEND_NAME);
                        break;
                    case Constant.MSG_NET_CMD_GAME_TIME:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_PUNCH_CLOCK);
                        break;
                    case Constant.MSG_NET_CMD_CLIENT_READY:
                    case Constant.MSG_NET_CMD_CHECK_PROPERTY:
                    case Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT:
                    case Constant.MSG_NET_CMD_CHECK_MEFFECT:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_CMD_SET_VERSION:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        //#if NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
//#                         dOut.writeByte(0);
                        //#elif NOKIA_S60V5
                         dOut.writeByte(2);
                        //#else
//#                        dOut.writeByte(1);
                        //#endif
                        break;
                    case Constant.MSG_NET_CMD_CHANGE_PASSWORD:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_OLD_PASSWD);
                        dOut.writeUTF(GameBean.STR_CMD_LOGIN_PASSWORD);
                        dOut.writeUTF(GameBean.STR_CMD_SUPER_PASSWORD);
                        break;
                    case Constant.MSG_NET_CMD_PLAYER_TOP:
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_BUSINESS_OPEN://打开玩家的摊位
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_BUSINESS_OPT://调整摊位出售的物品
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        if (GameBean.BY_TYPE == 1 || GameBean.BY_TYPE == 3) {
                            dOut.writeInt(GameBean.I_MONEY);
                        }
                        break;
                    case Constant.MSG_NET_CMD_BUSINESS_BUY://购买玩家摊位出售的物品
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        dOut.writeByte(GameBean.BY_GOODS_NUM);
                        break;
                    case Constant.MSG_NET_CMD_CHECK_PLAYER_NICK://查看玩家的称号
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeLong(GameBean.L_PLAYER_ID);
                        break;
                    case Constant.MSG_NET_CMD_SET_PLAYER_NICK://设置玩家的当前称号
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_COUNT_BOX:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_CMD_COUNTBOX_TYPE);
                        break;
                    case Constant.MSG_NET_CMD_HANGUP_START:
                    case Constant.MSG_NET_CMD_OFFLINEHANG_OPEN:
                    case Constant.MSG_NET_CMD_ONLINEHANG_UI:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_OFFLINEHANG_EXTRACT:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeInt(MainLogic.getInstance().uiInterFace.property.iData[1]);
                        dOut.writeLong(GameBean.L_CMD_GOODS_SLOTKEY);
                        GameBean.L_CMD_GOODS_SLOTKEY = -1;
                        break;
                    case Constant.MSG_NET_CMD_ONLINEHANG:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        if (GameBean.BL_PLAYER_HANGUP) {
                            dOut.writeByte(0);
                        } else {
                            dOut.writeByte(1);
                        }
                        break;
                    case Constant.MSG_NET_CMD_NPC_CHANGE:
                        dOut.writeLong(GameBean.L_NPC_ID);
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        GameBean.L_NPC_ID = -1;
                        break;
                    case Constant.MSG_NET_CMD_ACTIVATION:
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeUTF(GameBean.STR_CMD_CDKEY);
                        break;
                    case Constant.MSG_NET_CMD_CHARGE://充值
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        dOut.writeByte(GameBean.BY_OP_TYPE);//充值方式（1，神州府,2易宝，3，当了）
                        dOut.writeUTF(GameBean.STR_CAHRGE_CARD_SN);//充值卡号
                        dOut.writeUTF(GameBean.STR_CHARGE_CARD_PW);//充值密码
                        dOut.writeByte(GameBean.BY_TYPE);//充值卡得类型方式（1，神州府,2易宝，3，当了）
                        dOut.writeShort((short) GameBean.I_MONEY);//充值金额
                        dOut.writeInt(Integer.parseInt(Constant.CHANNEL_NUM));
                        break;
                    case Constant.MSG_NET_CMD_CHARGE_LIST://充值明细
                        dOut.writeLong(MainLogic.getInstance().gamePlayer.lPlayerID);
                        break;
                    case Constant.MSG_NET_CMD_LOAD_OTHER:
                        break;
                }
            }
            MainLogic.getInstance().i_send_msgId = msgId;
            dOut.flush();
            msgData = byOut.toByteArray();
            dOut.close();
            byOut.close();
            dOut = null;
            byOut = null;
            if (Constant.DEBUG) {
                MainCanvas.popCallStack();
            }
            Tools.printLog("send(MSG_ID):" + msgId);
        } catch (Exception ex) {
            if (Constant.DEBUG) {
                ex.printStackTrace();
            }
            if (Constant.DEBUG) {
                MainCanvas.addLog("logic类发送消息处理出错！" + ex.toString());
            }
        }
        //发送消息体
        NetManager.getInstance().send(msgData, msgId);
        msgData = null;
    }
    //本地消息发送

    /**
     * 往消息队列里添加一个消息包
     * @param ve Vector 消息包
     */
    public void putVector(Vector ve) {
        synchronized (this.veNetMsgQueue) {
            this.veNetMsgQueue.addElement(ve);
        }
    }

    /**
     * 清空消息队列
     */
    public void clearVector() {
        if (this.veNetMsgQueue != null && !this.veNetMsgQueue.isEmpty()) {
            this.veNetMsgQueue.removeAllElements();
        }
    }

    /**
     * 删除第一个已执行的消息包
     */
    public void removeFirstVector() {
        synchronized (this.veNetMsgQueue) {
            this.veNetMsgQueue.removeElementAt(0);
        }
    }

    /**
     * 获取第一个消息包
     * @return Vector 消息包
     */
    public Vector getFirstVector() {
        return (Vector) this.veNetMsgQueue.firstElement();
    }

    /**
     * 获取最后一个消息包
     * @return Vector
     */
    public Vector getLastVector() {
        return (Vector) this.veNetMsgQueue.lastElement();
    }

    /**
     * 获取消息队列消息包数
     * @return int 消息包总数量
     */
    public int getVectorNums() {
        return this.veNetMsgQueue.size();
    }

    /**
     * 向消息队列添加消息
     * @param byData byte[] 网络消息包
     */
    private void putNetMsg(byte[] byData) {
        if (this.getVectorNums() > 0) {
            Vector newVe = this.getLastVector();
            if (newVe.size() < 1) {
                newVe.addElement(byData);
                newVe = null;
            } else {
                Vector newVe2 = new Vector();
                newVe2.addElement(byData);
                this.putVector(newVe2);
            }
        } else {
            Vector newVe2 = new Vector();
            newVe2.addElement(byData);
            this.putVector(newVe2);
        }
    }
    public static long lNpcIdForRes = 0L;

    public static void setResCode(long npcid) {
        lNpcIdForRes = npcid;
    }
    public static short res_state = -1;

    //设置资源命令的第一个状态
    public static void setResState(short resstate) {
        res_state = resstate;
    }

    public static short getResState() {
        return res_state;
    }

    public static long getResCode() {
        return lNpcIdForRes;
    }
    //设置网络资源数组
    private String[] strResArray;
    //设置res数组

    public void setMsgResArray(String[] resArray) {
        this.strResArray = resArray;
    }

    public String[] getMsgResArray() {
        return this.strResArray;
    }
    //地形ID
    private int iTerrain = 0;

    public void setTerrainId(int terrainid) {
        this.iTerrain = terrainid;
    }

    public int getTerrainId() {
        return this.iTerrain;
    }

    /**
     * 网络异常需要到登录界面
     */
    public void stopNetAndQuit() {
        MainLogic.getInstance().exitGame();
//        MainCanvas.blStopGame = true;
    }

    public void receiveLogicMSG(int msgId, DataInputStream cmdData) throws IOException {
    	receiverPart1(msgId, cmdData);
    	receiverPart2(msgId, cmdData);
    	receiverPart3(msgId, cmdData);
    	receiverPart4(msgId, cmdData);
    }

	private void receiverPart4(int msgId, DataInputStream cmdData) throws IOException {
		byte stateCode = 0,byColor=0,sex;
    	int i=0, j = 0;
    	int lMoney = 0, exp=0;
    	long lPlayerID = 0;
    	String desc = "",sGoodsName="" , playerName="";
    	short shGoodsLevel;
        switch (msgId) {
            case Constant.MSG_NET_CMD_QUESTION_INFO:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        MainLogic.getInstance().pushState(Constant.GAME_UI_QUESTION, true);
                        byte[] byData = new byte[4];
                        for (i = 0; i < byData.length; i++) {
                            byData[i] = cmdData.readByte();
                        }
                        MainLogic.getInstance().uiInterFace.getQuestionInfo(byData);
                        byData = null;
                        break;
                    case 2://时间未到
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "答题时间未到!", (byte) 1, (byte) -1);
                        break;
                    case 3://题目已经答完
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "你已经答完了今天的所有题目，请明天再来！", (byte) 1, (byte) -1);
                        break;
                    case 4://等级不够
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "等级不够！", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_QUESTION_RUN:
                stateCode = cmdData.readByte();
                int expQuestion = -1;
                if (stateCode == 1) {
                    expQuestion = cmdData.readUnsignedShort();
                }
                byte NumQuestion = cmdData.readByte();
                String titleQuestion = cmdData.readUTF();
                byte numsQuestion = cmdData.readByte();
                String[] answers = new String[numsQuestion];
                for (i = 0; i < numsQuestion; i++) {
                    answers[i] = cmdData.readUTF();
                }
                MainLogic.getInstance().uiInterFace.getQuestionRun(stateCode, expQuestion, NumQuestion, titleQuestion, answers);
                titleQuestion = null;
                answers = null;
                break;
            case Constant.MSG_NET_CMD_QUESTION_END:
                stateCode = cmdData.readByte();
                byte n = cmdData.readByte();
                int expQ = cmdData.readInt();
                numsQuestion = cmdData.readByte();
                MainLogic.getInstance().uiInterFace.getQuestionEnd(stateCode, n, expQ, numsQuestion);
                break;
            case Constant.MSG_NET_CMD_OPEN_INGOT_STORE:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                Tools.printLog("收到打开元宝商店信息");
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 1:
                        byte byShowPlayerInfo = cmdData.readByte();
                        byte byStoreType = cmdData.readByte();
                        byte bySubType = cmdData.readByte();
                        short shLevel;
                        byte bySex,
                         byJob;
                        int price,
                         iIconID;
                        String sGoodsKey;
                        short shStoreGoodsNum = cmdData.readShort();
                        Tools.printLog("接受到商品数量:" + shStoreGoodsNum);
                        bySubType = MainLogic.getInstance().uiInterFace.store.initOpenStore(byStoreType, shStoreGoodsNum, bySubType);
                        for (i = 0; i < shStoreGoodsNum; i++) {
                            sGoodsKey = cmdData.readUTF();
                            sGoodsName = cmdData.readUTF();
                            iIconID = cmdData.readInt();
                            byColor = cmdData.readByte();
                            shLevel = cmdData.readShort();
                            byJob = cmdData.readByte();
                            bySex = cmdData.readByte();
                            price = cmdData.readInt();
                            MainLogic.getInstance().uiInterFace.store.store[bySubType - 1].addGoods((short) i, true, -1L, (byte) -1, sGoodsName, (short) 1, iIconID, (byte) -1, byColor, byJob, bySex, (byte) -1, null, shLevel, price, (byte) -1, sGoodsKey);
                        }
                        if (byShowPlayerInfo == 1) {
                            switch (byStoreType) {
                                case 1:
                                    //热卖商品
                                    shStoreGoodsNum = cmdData.readByte();
                                    MainLogic.getInstance().uiInterFace.store.items = new Goods(shStoreGoodsNum, Constant.ITEM_COLUMN_TYPE_COMMON);
                                    for (i = 0; i < shStoreGoodsNum; i++) {
                                        sGoodsKey = cmdData.readUTF();
                                        sGoodsName = cmdData.readUTF();
                                        iIconID = cmdData.readInt();
                                        byColor = cmdData.readByte();
                                        shLevel = cmdData.readShort();
                                        byJob = cmdData.readByte();
                                        bySex = cmdData.readByte();
                                        price = cmdData.readInt();
                                        MainLogic.getInstance().uiInterFace.store.items.addGoods((short) i, true, -1L, (byte) -1, sGoodsName, (short) 1, iIconID, (byte) -1, byColor, byJob, bySex, (byte) -1, null, shLevel, price, (byte) -1, sGoodsKey);
                                    }
                                    sGoodsKey = null;
                                    break;
                            }
                            short shPlayerTotalBag = cmdData.readShort();
                            short shPlayerNowBag = cmdData.readShort();
                            int shPlayerIngot = cmdData.readInt();
                            MainLogic.getInstance().uiInterFace.store.setPlayerIngot(byShowPlayerInfo, shPlayerTotalBag, shPlayerNowBag, shPlayerIngot);

                        }
                        break;
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "商城打开超时!！");
                        break;
                    default:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "商城打开失败!！");
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_FUNC_INGOT_BUY:
                //购买元宝商城东西
                stateCode = cmdData.readByte();
                short shPlayerNowBag = 0;
                if (stateCode == 0) {
                    shPlayerNowBag = cmdData.readShort();//玩家剩余背包数量
                }
                MainLogic.getInstance().uiInterFace.store.completeIngotBuy(stateCode, shPlayerNowBag);
                break;
            case Constant.MSG_NET_CMD_MY_INGOT_RECORD:
                //我的收藏和购买记录
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 0) {
                    short shLevel;
                    byte bySex, byJob;
                    int price, iIconID;
                    String sGoodsKey;
                    short shGoodsNum = cmdData.readShort();
                    MainLogic.getInstance().uiInterFace.store.myItems = new Goods(shGoodsNum, Constant.ITEM_COLUMN_TYPE_COMMON);
                    for (i = 0; i < shGoodsNum; i++) {
                        sGoodsKey = cmdData.readUTF();
                        sGoodsName = cmdData.readUTF();
                        iIconID = cmdData.readInt();
                        byColor = cmdData.readByte();
                        shLevel = cmdData.readShort();
                        byJob = cmdData.readByte();
                        bySex = cmdData.readByte();
                        price = cmdData.readInt();
                        MainLogic.getInstance().uiInterFace.store.myItems.addGoods((short) i, true, -1L, (byte) -1, sGoodsName, (short) 1, iIconID, (byte) -1, byColor, byJob, bySex, (byte) -1, null, shLevel, price, (byte) -1, sGoodsKey);
                    }
                    byte byHotStoreGoodsNum = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.store.items = new Goods(byHotStoreGoodsNum, Constant.ITEM_COLUMN_TYPE_COMMON);
                    for (i = 0; i < byHotStoreGoodsNum; i++) {
                        sGoodsKey = cmdData.readUTF();
                        sGoodsName = cmdData.readUTF();
                        iIconID = cmdData.readInt();
                        byColor = cmdData.readByte();
                        shLevel = cmdData.readShort();
                        byJob = cmdData.readByte();
                        bySex = cmdData.readByte();
                        price = cmdData.readInt();
                        MainLogic.getInstance().uiInterFace.store.items.addGoods((short) i, true, -1L, (byte) -1, sGoodsName, (short) 1, iIconID, (byte) -1, byColor, byJob, bySex, (byte) -1, null, shLevel, price, (byte) -1, sGoodsKey);
                    }
                    short shPlayerBag = cmdData.readShort();
                    shPlayerNowBag = cmdData.readShort();
                    int iIngotNum = cmdData.readInt();
                    MainLogic.getInstance().uiInterFace.store.openIngotRecord((byte) 1, shPlayerBag, shPlayerNowBag, iIngotNum);
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开购买记录失败");
                }
                break;
            case Constant.MSG_NET_CMD_FUNC_STORE_ITEM_COLLECT:
                //收藏和取消收藏
                stateCode = cmdData.readByte();
                break;
            case Constant.MSG_NET_CMD_FUNC_STORE_GIFT:
                //赠送
                stateCode = cmdData.readByte();
                break;
            case Constant.MSG_NET_CMD_GAME_TIME:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                short time = cmdData.readShort();
                Tools.printLog("在线时长：：：" + time);
                stateCode = cmdData.readByte();
                Tools.printLog("是否有奖励：：：" + stateCode);
                String goodsName = null;
                switch (stateCode) {
                    case 0://没有奖励物品
                        MainLogic.getInstance().uiInterFace.sArray[7] = "您今天的在线时间为" + time + "分钟，您目前没有奖励物品！";
                        break;
                    case 1:
                        goodsName = cmdData.readUTF();
                        MainLogic.getInstance().uiInterFace.sArray[7] = "您今天的在线时间为" + time + "分钟，现在可获得的奖励是" + goodsName;
                        break;
                    case 2://领取过了奖励物品
                        MainLogic.getInstance().uiInterFace.sArray[7] = "您今天的在线时间为"
                                + time + "分钟，您已经领取了奖励物品!";
                        MainLogic.getInstance().uiInterFace.sArray[8] = "无法多次领取奖励！";
                        break;
                }
                if (stateCode != 2) {
                    byte hasNext = cmdData.readByte();
                    switch (hasNext) {
                        case 0:
                            MainLogic.getInstance().uiInterFace.sArray[8] = "您当前的奖励已是最高奖励！";
                            break;
                        case 1:
                            short nextTime = cmdData.readShort();
                            String nextGoodName = cmdData.readUTF();
                            MainLogic.getInstance().uiInterFace.sArray[8] = "再过" + nextTime + "分钟，您可以领取的奖励是" + nextGoodName;
                            nextGoodName = null;
                            break;
                    }
                }
                MainLogic.getInstance().uiInterFace.byUiState = 2;
                goodsName = null;
                break;
            case Constant.MSG_NET_CMD_CHECK_PROPERTY:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                String tongNo;
                stateCode = cmdData.readByte();
                if (stateCode == 0) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取角色信息失败",
                            (byte) 1, (byte) -1);
                } else if (stateCode == 1) {
                    MainLogic.getInstance().pushState(Constant.GAME_UI_PLAYER_INFO, true);
                    playerName = cmdData.readUTF();
                    short level = cmdData.readShort();
                    byte duty = cmdData.readByte();
                    sex = cmdData.readByte();
                    int[] iData = new int[9];
                    for (i = 0; i < iData.length; i++) {
                        iData[i] = cmdData.readInt();
                    }
                    tongNo = cmdData.readUTF();
                    byte pk = cmdData.readByte();
                    byte byNick = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.property.getPlayerInfo(playerName, level, duty, sex, iData, tongNo, pk, byNick);
                    playerName = null;
                    iData = null;
                    tongNo = null;
                }
                break;
            case Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 0) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获取角色加点失败",
                            (byte) 1, (byte) -1);
                } else if (stateCode == 1) {
                    MainLogic.getInstance().pushState(Constant.GAME_UI_PROPERTY_ADD_POINT, true);
                    int[] iData = new int[24];
                    for (i = 0; i < iData.length; i++) {
                        iData[i] = cmdData.readInt();
                    }
                    MainLogic.getInstance().uiInterFace.property.getPropertyAddPoint(iData);
                    iData = null;
                }
                break;
            case Constant.MSG_NET_CMD_CONTINUE_EFFECT:
                int hp = cmdData.readInt();
                int mp = cmdData.readInt();
//                System.out.println("持续血蓝：：：" + hp + "，" + mp);
                MainLogic.damage.addDamage((byte) -1, MainLogic.damage.DAMAGE_TYPE_PLAYER,
                        hp, false, MainLogic.getInstance().gamePlayer.byPlayerDirection,
                        (int) MainLogic.getInstance().gamePlayer.iPlayerX - MainLogic.gameMap.iMapWorldOffsetX,
                        (int) MainLogic.getInstance().gamePlayer.iPlayerY - MainLogic.gameMap.iMapWorldOffsetY,
                        (short) 60);
                MainLogic.damage.addDamage((byte) -1, MainLogic.damage.DAMAGE_TYPE_ICE,
                        mp, false, MainLogic.getInstance().gamePlayer.byPlayerDirection,
                        (int) MainLogic.getInstance().gamePlayer.iPlayerX - MainLogic.gameMap.iMapWorldOffsetX,
                        (int) MainLogic.getInstance().gamePlayer.iPlayerY - MainLogic.gameMap.iMapWorldOffsetY,
                        (short) 60);
                break;
            case Constant.MSG_NET_CMD_CLEAN_EFFECT:
                stateCode = cmdData.readByte();
                //清除buffer
                SkillBuff aSkillBuff = (SkillBuff) SkillBuffManager.buffTable.get(new Long(MainLogic.getInstance().gamePlayer.lPlayerID));
                if (aSkillBuff != null) {
                    for (i = 0; i < SkillBuffManager.buffTable.size(); i++) {
                        if (aSkillBuff != null && aSkillBuff.iType[i] != 2) {
                            aSkillBuff.clearBuff(i);
                        }
                    }
                }
                aSkillBuff = null;
                break;
            case Constant.MSG_NET_CMD_CHECK_MEFFECT:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                MainLogic.getInstance().pushState(Constant.GAME_UI_BUFFER_LIST, true);
                byte bufferNum = cmdData.readByte();
                MainLogic.getInstance().uiInterFace.property.setNum(bufferNum);
                String bufferName = null;
                String bufferInfo = null;
                long bufferId;
                byte isChange;
                int totalTime;
                int pastTime;
                short onLineTime;
                for (i = 0; i < bufferNum; i++) {
                    bufferId = cmdData.readLong();
                    bufferName = cmdData.readUTF();
                    totalTime = cmdData.readInt();
                    pastTime = cmdData.readInt();
                    bufferInfo = cmdData.readUTF();
                    isChange = cmdData.readByte();
                    Tools.printLog("buffer名字：：" + bufferName + "，总时间：：" + totalTime + "，已用时间：" + pastTime + "，buffer描述：" + bufferInfo);
                    MainLogic.getInstance().uiInterFace.property.setInfo(i, bufferId, bufferName, totalTime, pastTime, bufferInfo, isChange);
                    MainLogic.getInstance().uiInterFace.property.setTime(i, MainLogic.getInstance().uiInterFace.property.buffTime[i]);
                }
                onLineTime = cmdData.readShort();
                Tools.printLog("在线时长：：：" + onLineTime);
                MainLogic.getInstance().uiInterFace.property.setOnLineTime(onLineTime);
                bufferName = null;
                bufferInfo = null;
                break;
            case Constant.MSG_NET_CMD_CHANGE_PASSWORD:
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "修改失败请重试,请再游戏设置中修改", (byte) 1, (byte) -1);
                        break;
                    case 1:
                        Rms.saveGame(Constant.RMS_LOGIN_USENAME_PASSWORD, null);
                        Rms.saveGame(Constant.RMS_SUPER_PASSWD, null);
                        GameBean.BL_CMD_QUICK_REGISTER = false;
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "恭喜！修改成功！|用户名：<k" + GameBean.STR_CMD_LOGIN_USENAME + ">|密码:<k" + GameBean.STR_CMD_LOGIN_PASSWORD + ">|,二级密码：<k" + GameBean.STR_CMD_SUPER_PASSWORD + ">|请牢记！");
                        GameBean.STR_CMD_SUPER_PASSWORD = null;
                        GameBean.STR_CMD_LOGIN_USENAME = null;
                        GameBean.STR_CMD_NEW_PASSWD = null;
                        GameBean.STR_CMD_OLD_PASSWD = null;
                        break;
                    case 2://1101
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "用户不存在");
                        break;
                    case 3:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您输入的二级密码不正确");
                        break;
                    default:
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "修改失败请重试", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_PLAYER_TOP:
                stateCode = cmdData.readByte();
                if (stateCode < 1 && stateCode > 13) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有找到该类型的排行榜数据");
                    break;
                }
                byte byNum = cmdData.readByte();
                if (byNum <= 0) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有找到该类型的排行榜数据");
                    break;
                }
                String[] sList;
                switch (stateCode) {
                    case 1:
                    case 2:
                    case 3:
                        sList = new String[byNum * 5];
                        for (i = 0; i < byNum; i++) {
//                            System.out.println("i=" + i);
                            sList[i * 5] = String.valueOf(cmdData.readLong());
                            sList[i * 5 + 1] = cmdData.readUTF();
                            sList[i * 5 + 2] = Tools.getJobName(cmdData.readByte());
                            sList[i * 5 + 3] = String.valueOf(cmdData.readShort());
                            sList[i * 5 + 4] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 5);
                        }
                        break;
                    case 4:
                    case 5:
                    case 6:
                        sList = new String[byNum * 4];
                        for (i = 0; i < byNum; i++) {
                            sList[i * 4] = String.valueOf(cmdData.readLong());
                            sList[i * 4 + 1] = cmdData.readUTF();
                            sList[i * 4 + 2] = String.valueOf(cmdData.readShort());
                            sList[i * 4 + 3] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 4);
                        }
                        break;
                    case 7:
                        sList = new String[byNum * 5];
                        for (i = 0; i < byNum; i++) {
//                            System.out.println("i=" + i);
                            sList[i * 5] = String.valueOf(cmdData.readLong());
                            sList[i * 5 + 1] = cmdData.readUTF();
                            sList[i * 5 + 2] = cmdData.readByte() == Constant.PLAYER_SEX_MAN ? "男" : "女";
                            sList[i * 5 + 3] = Tools.moneyConvert(cmdData.readLong());
                            sList[i * 5 + 4] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 5);
                        }
                        break;
                    case 8:
                    case 9:
                        sList = new String[byNum * 4];
                        for (i = 0; i < byNum; i++) {
                            sList[i * 4] = String.valueOf(cmdData.readLong());
                            sList[i * 4 + 1] = cmdData.readUTF();
                            sList[i * 4 + 2] = Tools.moneyConvert(cmdData.readLong());
                            sList[i * 4 + 3] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 4);
                        }
                        break;
                    case 10:
                    case 11:
                    case 12:
                        sList = new String[byNum * 4];
                        for (i = 0; i < byNum; i++) {
                            sList[i * 4] = String.valueOf(cmdData.readLong());
                            sList[i * 4 + 1] = cmdData.readUTF();
                            sList[i * 4 + 2] = String.valueOf(cmdData.readInt());
                            sList[i * 4 + 3] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 4);
                        }
                        break;
                    case 13:
                        sList = new String[byNum * 5];
                        for (i = 0; i < byNum; i++) {
                            sList[i * 5] = String.valueOf(cmdData.readLong());
                            sList[i * 5 + 1] = cmdData.readUTF();
                            sList[i * 5 + 2] = String.valueOf(cmdData.readByte());
                            sList[i * 5 + 3] = String.valueOf(cmdData.readShort());
                            sList[i * 5 + 4] = String.valueOf(cmdData.readByte());
                        }
                        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_TOP) {
                            MainLogic.getInstance().uiInterFace.property.setPlayerTopData(sList, (byte) 5);
                        }
                        break;
                }
                sList = null;
                break;
            case Constant.MSG_NET_CMD_BUSINESS_OPEN://打开玩家的摊位
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1 || stateCode == 2) {
                    MainLogic.getInstance().uiInterFace.store.lMoney = cmdData.readLong();
//                    System.out.println("MainLogic.getInstance().uiInterFace.store.lMoney=" + MainLogic.getInstance().uiInterFace.store.lMoney);
                    lPlayerID = cmdData.readLong();
//                    System.out.println("lPlayerID=" + lPlayerID);
                    String sPlayerName = cmdData.readUTF();
                    MainLogic.getInstance().uiInterFace.store.lTraderID = lPlayerID;
                    MainLogic.getInstance().uiInterFace.store.sArray[0] = stateCode == 2 ? sPlayerName + "的摊位" : "我的摊位";
                    byte byCanUse = cmdData.readByte();
                    byte bySoldNum = cmdData.readByte();
                    byte byGoodsIndex;
                    long lGoodsKey;
                    byte byGoodsNum;
                    String SGoodsName;
                    byte byJob;
                    byte byDuratilty;
                    int iPrice;
                    int iIconID;
                    MainLogic.getInstance().uiInterFace.store.items.init(byCanUse, Constant.ITEM_COLUMN_TYPE_COMMON);
                    for (i = 0; i < bySoldNum; i++) {
                        byGoodsIndex = cmdData.readByte();
                        lGoodsKey = cmdData.readLong();
                        SGoodsName = cmdData.readUTF();
                        byGoodsNum = cmdData.readByte();
                        iIconID = cmdData.readInt();
                        shGoodsLevel = cmdData.readShort();
                        byColor = cmdData.readByte();
                        byJob = cmdData.readByte();
                        byDuratilty = cmdData.readByte();
                        iPrice = cmdData.readInt();
                        MainLogic.getInstance().uiInterFace.store.items.addGoods(byGoodsIndex, true, lGoodsKey, (short) -1, SGoodsName, byGoodsNum, iIconID, (byte) -1, byColor, byJob, (byte) -1, (byte) -1, null, shGoodsLevel, iPrice, byDuratilty, null);
                    }
                    if (MainLogic.getInstance().uiInterFace.store.items.checkColumnHasGoods(MainLogic.getInstance().uiInterFace.store.shPos)) {
                        MainLogic.getInstance().uiInterFace.store.sGoodsPrice = "售价：" + Tools.moneyConvert(MainLogic.getInstance().uiInterFace.store.items.getGoodsPrice(MainLogic.getInstance().uiInterFace.store.shPos)) + " / 个";
                    }
                } else {
                    MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                    switch (stateCode) {
                        case 0:
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打孔摊位失败!");
                            break;
                        case 3:
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "摊主不在线!");
                            break;
                        case 4:
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "玩家等级不够!");
                            break;
                    }
                }
                break;
            case Constant.MSG_NET_CMD_BUSINESS_OPT://调整摊位出售的物品
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    byte byGoodsIndex = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.store.stallItemsOpt(stateCode, byGoodsIndex);
                } else {
                    MainLogic.getInstance().uiInterFace.store.stallItemsOpt(stateCode, (byte) -1);
                }
                break;
            case Constant.MSG_NET_CMD_BUSINESS_BUY://购买玩家摊位出售的物品
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 1:
                        byte byGoodsNum = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.store.buyStallItems(stateCode, byGoodsNum, (byte) -1);
                        break;
                    case 9:
                        byte index = cmdData.readByte();
                        byGoodsNum = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.store.buyStallItems(stateCode, byGoodsNum, index);
                        break;
                    default:
                        MainLogic.getInstance().uiInterFace.store.buyStallItems(stateCode, (byte) -1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_CHECK_PLAYER_NICK://查看玩家的称号
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    byte byNickNum = cmdData.readByte();
                    if (byNickNum == 0) {
                        switch (MainLogic.getInstance().byGameState) {
                            case Constant.GAME_UI_PLAYER_INFO:
                                MainLogic.getInstance().uiInterFace.property.setPlayerNick(null);
                                break;
                            case Constant.GAME_UI_LOOK_OTHERPLAYER:
                                MainLogic.getInstance().uiInterFace.setPlayerNick(null);
                                break;
                        }
                        break;
                    }
                    byte byNicks[] = new byte[byNickNum];
                    for (i = 0; i < byNickNum; i++) {
                        byNicks[i] = cmdData.readByte();
                    }
                    switch (MainLogic.getInstance().byGameState) {
                        case Constant.GAME_UI_PLAYER_INFO:
                            MainLogic.getInstance().uiInterFace.property.setPlayerNick(byNicks);
                            break;
                        case Constant.GAME_UI_LOOK_OTHERPLAYER:
                            MainLogic.getInstance().uiInterFace.setPlayerNick(byNicks);
                            break;
                    }
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "获得称号失败!");
                }
                break;
            case Constant.MSG_NET_CMD_SET_PLAYER_NICK://设置玩家的当前称号
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                MainLogic.getInstance().uiInterFace.property.setPlayerCurrentNick(stateCode);
                break;
            case Constant.MSG_NET_CMD_COUNT_BOX:
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    QuickOption.byBoxType += 1;
                    QuickOption.initBox();
                }
                break;
            case Constant.MSG_NET_CMD_HANGUP_START:
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "离线挂机开启失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您已开启离线挂机，在您下线后，离线经验会开始累积!", (byte) 1, (byte) -1);
                        break;
                    case 2://等级不够
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "只有30级及以上玩家才能开启离线挂机功能!", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_OFFLINEHANG_OPEN:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开界面失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        exp = cmdData.readInt();
                        MainLogic.getInstance().pushState(Constant.GAME_UI_HANGUP, true);
                        MainLogic.getInstance().uiInterFace.property.bySubSelectIndex = 2;
                        MainLogic.getInstance().uiInterFace.property.getTotalExp(exp);
                        break;
                    case 2://等级不符
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开界面失败！|只有30-60级的玩家才可打开离线挂机界面!", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_OFFLINEHANG_EXTRACT:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "提取经验失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "提取经验成功!", (byte) 1, (byte) -1);
                        MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                        break;
                    case 2://等级不符
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "等级不符!", (byte) 1, (byte) -1);
                        break;
                    case 3://幻蝶仙丹不足
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "幻蝶仙丹数量不足!", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_ONLINEHANG_UI:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "打开在线挂机界面失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        int time1 = cmdData.readInt();
                        short time2 = cmdData.readShort();
                        Tools.printLog("时间：：" + time1 + "," + time2);
                        MainLogic.getInstance().pushState(Constant.GAME_UI_HANGUP, true);
                        MainLogic.getInstance().uiInterFace.property.getHangUpTime(time1, time2);
//                        MainLogic.getInstance().uiInterFace.property.getHangUpTime(cmdData.readInt(), cmdData.readShort());
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_ONLINEHANG:
                GameBean.b_WAIT_NET_MSG_BACK = false;
                stateCode = cmdData.readByte();
                Tools.printLog("挂机设置状态码：：" + stateCode);
                switch (stateCode) {
                    case 0://失败
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "在线挂机设置失败!", (byte) 1, (byte) -1);
                        break;
                    case 1://成功
                        GameBean.BL_PLAYER_HANGUP = !GameBean.BL_PLAYER_HANGUP;
                        if (GameBean.BL_PLAYER_HANGUP) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您已经开始在线挂机!", (byte) 1, (byte) -1);
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的在线挂机已经结束!", (byte) 1, (byte) -1);
                        }
                        MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                        break;
                    case 2://等级不够
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "15级以上的玩家方可开启在线挂机!", (byte) 1, (byte) -1);
                        break;
                    case 3://场景错误
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该场景不允许挂机!", (byte) 1, (byte) -1);
                        break;
                    case 4://没有挂机时间
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可用挂机时间!", (byte) 1, (byte) -1);
                        break;
                }
                break;
            case Constant.MSG_NET_CMD_ACTIVATION:
                stateCode = cmdData.readByte();
                if (stateCode == 1) {
                    String activeName = cmdData.readUTF();
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "激活码兑换成功！，您获得了“" + activeName + "”，祝您游戏愉快");
                    activeName = null;
                } else if (stateCode == 2) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您输入的激活码不存在!");
                } else if (stateCode == 3) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该激活码已经使用过了!!");
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "激活码兑换失败，请重试!!");
                }
                break;
            case Constant.MSG_NET_CMD_CHARGE://充值
                String sMess = cmdData.readUTF();
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", sMess);
                break;
            case Constant.MSG_NET_CMD_CHARGE_LIST://充值明细
                byte chargeNum = cmdData.readByte();
                if (chargeNum > 0) {
                    String[] list = new String[chargeNum];
                    for (i = 0; i < chargeNum; i++) {
                        list[i] = cmdData.readUTF();
                    }
                    MainLogic.getInstance().uiInterFace.gameSet.openChargeList(list);
                } else {
                    MainLogic.getInstance().uiInterFace.gameSet.openChargeList(null);
                }
                break;
            case Constant.MSG_NET_CMD_LOAD_OTHER://载入玩家的其他信息
                short shPlayerSkillNum = cmdData.readShort();
                String sPlayerSkillKey;
                int iPlayerSkillskillID;
                String sPlayerSkillActID;
                byte byPlayerSkillType;
                int iPlayerCoolTime;
                int ikillDistance;
                int ikillMp;
                byte bykillAttackType;
                try {
                    for (j = 0; j < shPlayerSkillNum; j++) {
                        sPlayerSkillKey = cmdData.readUTF();
                        iPlayerSkillskillID = cmdData.readInt();
                        sPlayerSkillActID = cmdData.readUTF();
                        byPlayerSkillType = cmdData.readByte();
                        iPlayerCoolTime = cmdData.readInt();
//技能施法距离(4byte)技能耗蓝(4byte)技能攻击类型(byte)
                        ikillDistance = cmdData.readInt();
                        ikillMp = cmdData.readInt();
                        bykillAttackType = cmdData.readByte();
                        MainLogic.getInstance().gamePlayer.addPlayerSkill(shPlayerSkillNum, j, sPlayerSkillKey, byPlayerSkillType, iPlayerSkillskillID,
                                sPlayerSkillActID, iPlayerCoolTime, ikillDistance, ikillMp, bykillAttackType);
                        Tools.printLog("技能K" + sPlayerSkillKey + "byPlayerSkillType" + byPlayerSkillType);
                    }
                    if (Constant.DEBUG) {
                        MainCanvas.addLog("loadskill ok");
                    }
                } catch (Exception e) {
                    if (Constant.DEBUG) {
                        MainCanvas.addLog("loadskill failed" + e.getMessage());
                    }
                }
                MainLogic.getInstance().aSkillManager.readSkillActionPrefence(26);
                //人物的avatar
                byte playeravatarNums = cmdData.readByte();
                String playeravatarId;
                byte playeravatarPos;
                for (j = 0; j < playeravatarNums; j++) {
                    playeravatarId = cmdData.readUTF();
                    playeravatarPos = cmdData.readByte();
                    MainLogic.getInstance().gamePlayer.addAvatorAni(playeravatarId, playeravatarPos, false);
                }

                String buffid = null;
                byte bufftype = -1;
                int continueTime = -1;
                int passTime = -1;
                byte bufficon = -1;
                //发起方buff个数
                byte buffnums = cmdData.readByte();
                Tools.printLog("进入游戏时的buffer数量：" + buffnums);
                byte doubleExp = 0;
                for (j = buffnums - 1; j >= 0; j--) {
                    buffid = cmdData.readUTF();
                    bufftype = cmdData.readByte();
                    continueTime = cmdData.readInt();
                    passTime = cmdData.readInt();
                    bufficon = cmdData.readByte();
                    doubleExp = cmdData.readByte();
                    if (doubleExp == 1)//有双倍经验
                    {
                        GameBean.BL_PLAYER_HANGUP_DOUBLEEXP = true;
                    }
                    Tools.printLog("进入游戏时的buffer图标：" + bufficon + "，已用时：" + passTime);
                    SkillBuffManager.addToBuffTable(j, MainLogic.getInstance().gamePlayer.lPlayerID, buffid, bufftype, -1, continueTime, passTime, bufficon);
                }
                /**
                 * 守护的宠物
                ////                                         */
                byte bHasPet = cmdData.readByte();
                Tools.printLog("bHasPet=" + bHasPet);
                if (bHasPet == 1) {
                    String sAvatarID = cmdData.readUTF();
                    Tools.printLog("sAvatarID=" + sAvatarID);
                    String sPetNick = cmdData.readUTF();
                    Tools.printLog("sPetNick=" + sPetNick);
                    short shPetHeight = cmdData.readShort();
                    Tools.printLog("shPetHeight=" + shPetHeight);
                    byte byPetHappy = cmdData.readByte();
                    Tools.printLog("byPetHappy=" + byPetHappy);
                    MainLogic.getInstance().gamePlayer.addPetsAni(Integer.parseInt(sAvatarID), shPetHeight, sPetNick, byPetHappy);
                    sPetNick = null;
                    sAvatarID = null;
                }//客户端
                MainLogic.getInstance().bClientIsReady = true;
                MainLogic.blLogined = true;
                break;
        }
	}

	private void receiverPart3(int msgId, DataInputStream cmdData) throws IOException {
		byte stateCode = 0;
		int i = 0, j = 0;

    	int lMoney = 0;
    	long lPlayerID = 0;
    	String desc = "";
		switch (msgId) {
	case Constant.MSG_NET_CMD_OTHER_PLAYER_DETAIL:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        long playerId = cmdData.readLong();
        if (playerId == 0) {
            MainLogic.uiInterFace.sysMessage.showMessage("提示", "查看失败!");
            break;
        }
        MainLogic.getInstance().pushState(Constant.GAME_UI_LOOK_OTHERPLAYER, true);
        GameBean.L_PLAYER_ID = playerId;
        int playerLv = cmdData.readInt();
        String playerName = cmdData.readUTF();
        byte playerDuty = cmdData.readByte();
        String tongName = cmdData.readUTF();
        byte name = cmdData.readByte();
        int iGoodsIconID;
        short shGoodsLevel;
        byte byEquipmentPos,
         byGoodsColor,
         equipIndex,
         byDurability;
        int[] Data = new int[8];
        String sGoodsName;
        for (i = 0; i < Data.length; i++) {
            Data[i] = cmdData.readInt();
        }
        MainLogic.getInstance().uiInterFace.getOtherPlayerInfo(playerLv, playerName, playerDuty, tongName, name, Data);
        short equiNum = cmdData.readShort();
        for (i = 0; i < equiNum; i++) {
            sGoodsName = cmdData.readUTF();
            iGoodsIconID = cmdData.readInt();
            shGoodsLevel = cmdData.readShort();
            byEquipmentPos = cmdData.readByte();
            byGoodsColor = cmdData.readByte();
            equipIndex = MainLogic.getInstance().uiInterFace.equipGoods.getEquipColumnIndex(byEquipmentPos);
            byDurability = cmdData.readByte();
            MainLogic.getInstance().uiInterFace.equipGoods.addEquipment(equipIndex, true, sGoodsName, iGoodsIconID, byEquipmentPos, byGoodsColor, (byte) shGoodsLevel, byDurability, playerDuty, (byte) 0);
        }
        playerName = null;
        tongName = null;
        Data = null;
        sGoodsName = null;
//    Tools.printLog("读取完成");
        break;
    case Constant.MSG_NET_CMD_SELECT_PET_POTENTIAL_ITEM:
        stateCode = cmdData.readByte();
        if (stateCode == 1) {
            byte byItemType = cmdData.readByte();
            if (byItemType == 1) {
                short[] shPetState = new short[4];
                shPetState[0] = cmdData.readShort();//当前潜能;
                shPetState[1] = cmdData.readShort();//1,总潜能
                shPetState[2] = cmdData.readByte();//资质
                shPetState[3] = cmdData.readByte();//成长
                ////成长率,资质,当前潜能，总的潜能
                MainLogic.getInstance().uiInterFace.pet.petPowerStrengthItems(stateCode, (byte) 1, MainLogic.getInstance().uiPackage.getCurrentPackage(), MainLogic.getInstance().uiPackage.shPos, null, shPetState);
                shPetState = null;
            } else {
                desc = cmdData.readUTF();
                MainLogic.getInstance().uiInterFace.pet.petPowerStrengthItems(stateCode, (byte) 2, MainLogic.getInstance().uiPackage.getCurrentPackage(), MainLogic.getInstance().uiPackage.shPos, desc, null);
                desc = null;
            }
        } else {
            MainLogic.getInstance().uiInterFace.pet.petPowerStrengthItems(stateCode, (byte) -1, null, (short) -1, null, null);
        }
        break;
    case Constant.MSG_NET_CMD_PET_FUNC_POTENTIAL_EXCITE:
        stateCode = cmdData.readByte();
        short shCurrentPower = -1;
        short shTotalPower = -1;
        byte byPetDisappear = 0;
        byte byGrowth = -1;
        desc = null;
        if (stateCode == 1) {
            byPetDisappear = cmdData.readByte();
            if (byPetDisappear == 0) {
                shCurrentPower = cmdData.readShort();
                shTotalPower = cmdData.readShort();
                byGrowth = cmdData.readByte();
                desc = cmdData.readUTF();
                Tools.printLog(shCurrentPower + desc + shTotalPower);
            }
        }
        MainLogic.getInstance().uiInterFace.pet.PetPowerExcite(stateCode, byPetDisappear, shCurrentPower, shTotalPower, desc, byGrowth);
        desc = null;
        break;
    case Constant.MSG_NET_CMD_PET_EQUIP_USE:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiInterFace.pet.petUseItem(stateCode);
        break;
//CMD_CHANGE_AVATAR (4byte)	类型 (byte) 1---玩家变成npc  2---变回玩家自己 Animation Id (4byte)
    case Constant.MSG_NET_CMD_CHANGE_AVATAR:
        stateCode = cmdData.readByte();
        int aniId = cmdData.readInt();
        Tools.printLog("玩家变身：type" + stateCode + "aniId:" + aniId);
        MainLogic.getInstance().gamePlayer.iPlayerAniId = aniId;
        if (stateCode == 1) {
            ResManager.loadAnimation(aniId, Constant.RES_PUBLIC_ONEROOM, false);
        } else if (stateCode == 2) {
//      ResManager.loadAnimation(aniId, Constant.RES_PUBLIC_ONEROOM, false);
        }
        break;
    case Constant.MSG_NET_CMD_GET_SEND_POINT:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        short shTransferPlaceNum = cmdData.readShort();
//        System.out.println("shTransferPlaceNum  " + shTransferPlaceNum);
        if (shTransferPlaceNum == 0) {
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有找到任何的传送点!");
            break;
        }
        if (shTransferPlaceNum > 0) {
            String key;
            String sTransName;
            byte index;
            int sTransLimitLevel, sTransX, sTransY;
            String[] sTransferList = new String[shTransferPlaceNum * 5];
            for (i = 0; i < shTransferPlaceNum; i++) {
                key = cmdData.readUTF();
                index = cmdData.readByte();
                sTransName = cmdData.readUTF();
                sTransLimitLevel = cmdData.readShort();
                sTransX = cmdData.readInt();
                sTransY = cmdData.readInt();
                if (index >= 0 && index < shTransferPlaceNum) {
                    sTransferList[index * 5] = key;
                    sTransferList[index * 5 + 1] = sTransName;
                    sTransferList[index * 5 + 2] = String.valueOf(sTransLimitLevel);
                    sTransferList[index * 5 + 3] = String.valueOf(sTransX);
                    sTransferList[index * 5 + 4] = String.valueOf(sTransY);
                }
            }
            sTransName = null;
            key = null;
            MainLogic.getInstance().uiInterFace.npcTalk.setTransferList(sTransferList);
            sTransferList = null;
        } else {
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有找到任何的传送点");
        }
        break;
    case Constant.MSG_NET_CMD_QUEST_FIND_PATH:
        String taskName = cmdData.readUTF();
        String taskKey = cmdData.readUTF();
        int iTaskX = cmdData.readInt();
        int iTaskY = cmdData.readInt();
        Tools.printLog("taskName=" + taskName + "#taskKey=" + taskKey + "#iTaskX=" + iTaskX + "#iTaskY=" + iTaskY);
        MainLogic.getInstance().uiInterFace.npcTalk.openTaskAutoFindPath(taskName, taskKey, iTaskX, iTaskY);
        taskName = null;
        taskKey = null;
        break;
    case Constant.MSG_NET_CMD_EQUIP_BIND:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiPackage.bindEquip(stateCode);
        break;
    case Constant.MSG_NET_CMD_QUIT_CONTEST:
        stateCode = cmdData.readByte();
        Tools.printLog("退出切磋状态：：" + stateCode);
        if (stateCode == 1) {
            if (MainLogic.getInstance().gamePlayer.blPkState) {
                MainLogic.getInstance().gamePlayer.blPkState = false;
                MainLogic.getInstance().uiInterFace.uichat_index = 0;
                MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "切磋结束!");
            }
        }
        break;
    case Constant.MSG_NET_CMD_GET_APPLY_TONG_LIST:
        GameBean.BY_CMD_APPLY_FIGHT_TYPE = cmdData.readByte();
        MainLogic.getInstance().pushState(Constant.GAME_UI_APPLY_TONG_LIST, true);
        short applyTongNum = cmdData.readShort();
        MainLogic.getInstance().uiInterFace.tong.getApplyTongNumber(applyTongNum);
        short tongLev = -1;
        for (i = 0; i < applyTongNum; i++) {
            tongName = cmdData.readUTF();
            tongLev = cmdData.readShort();
            MainLogic.getInstance().uiInterFace.tong.getApplyTongListInfo(i, tongName, tongLev);
        }
        tongName = null;
        break;
    case Constant.MSG_NET_CMD_SEND_ARENA_INTEGRAL:
        short integral = cmdData.readShort();
        MainLogic.getInstance().gamePlayer.integral = integral;
        break;
    case Constant.MSG_NET_CMD_INSTALL_BUFF:
        stateCode = cmdData.readByte();
        if (stateCode == 1) {//发起方中buffer
            Tools.printLog("发起方中buffer");
            SkillBuff aSkillBuff = (SkillBuff) SkillBuffManager.buffTable.get(new Long(MainLogic.getInstance().gamePlayer.lPlayerID));
            String buffid = cmdData.readUTF();
            byte bufftype = cmdData.readByte();
            int continueTime = cmdData.readInt();
            Tools.printLog("buffer持续时间：：" + continueTime);
            byte bufficon = cmdData.readByte();
            Tools.printLog("安装时的buffer图标：" + bufficon);
            int temp = 0;
            if (aSkillBuff != null) {
                for (i = 0; i < Constant.BUFF_MAX_NUMS; i++) {
                    if (aSkillBuff.iBuffKey[i] != null) {
                        temp++;
                    } else {
                        break;
                    }
                }
            }
            aSkillBuff = null;
            SkillBuffManager.addToBuffTable(temp, MainLogic.getInstance().gamePlayer.lPlayerID,
                    buffid, bufftype, -1, continueTime, -1, bufficon);
            byte useGood = -1;
            byte useSkill = -1;
            short speed = -1;
            useGood = cmdData.readByte();
            useSkill = cmdData.readByte();
            speed = cmdData.readShort();
            //变身ID
            String avatarid = cmdData.readUTF();
            byte doubleExp = cmdData.readByte();
            GameBean.BL_PLAYER_HANGUP_DOUBLEEXP = (doubleExp == 1) ? true : false;//双倍经验
            MainLogic.getInstance().gamePlayer.changeAvatar(avatarid);
            MainLogic.getInstance().gamePlayer.blCanUseGoods = (useGood == 1) ? true : false;
            MainLogic.getInstance().gamePlayer.blCanUseSkill = (useSkill == 1) ? true : false;
            MainLogic.getInstance().gamePlayer.updateSpeed(speed);
        } else if (stateCode == 2) {//目标方中buffer
            Tools.printLog("目标方中buffer");
            String buffid = cmdData.readUTF();
            byte bufftype = cmdData.readByte();
            int continueTime = cmdData.readInt();
            Tools.printLog("buffer持续时间：：" + continueTime);
            byte bufficon = cmdData.readByte();
            Tools.printLog("安装时的buffer图标：" + bufficon);
            long otherId = cmdData.readLong();
            SkillBuff aSkillBuff = (SkillBuff) SkillBuffManager.buffTable.get(new Long(otherId));
            int temp = 0;
            if (aSkillBuff != null) {
                for (i = 0; i < Constant.BUFF_MAX_NUMS; i++) {
                    if (aSkillBuff.iBuffKey[i] != null) {
                        temp++;
                    } else {
                        break;
                    }
                }
            }
            aSkillBuff = null;
            SkillBuffManager.addToBuffTable(temp, otherId, buffid, bufftype, -1, continueTime, -1, bufficon);
        }
        break;
    case Constant.MSG_NET_CMD_SET_FLOW:
        stateCode = cmdData.readByte();
//    MainLogic.getInstance().uiEquipment.flow = (byte) (stateCode - 1);
//    System.out.println("flow22   " + MainLogic.getInstance().uiEquipment.flow);
        break;
    case Constant.MSG_NET_CMD_QUEST_SIMPLE_INFO:
        byte byIfReadTime = 0;
        int iTime = 0;
        byte byTaskType = cmdData.readByte();
        if (byTaskType == 0 || byTaskType == 1) {
            byIfReadTime = cmdData.readByte();
            if (byIfReadTime != 0) {
                iTime = cmdData.readInt();
            }
        }
        String sTasktarget = cmdData.readUTF();//任务目标

        if (byTaskType == 0 || byTaskType == 1) {
            byte collectItemsNum = cmdData.readByte();
            byte collectTotal;
            byte currentNum;
            String collectName;
            String sTemp = "";
            for (j = 0; j < collectItemsNum; j++) {
                collectTotal = cmdData.readByte();
                collectName = cmdData.readUTF();
                currentNum = cmdData.readByte();
                sTemp += collectName + ":" + String.valueOf(currentNum) + "/" + String.valueOf(collectTotal) + ";";
            }
            if (collectItemsNum > 0) {
                sTemp = "|" + "完成情况:" + sTemp + ((byIfReadTime > 0) ? (("剩余时间:" + String.valueOf(iTime / 3600)) + "时" + String.valueOf((iTime / 3600 == 0 && iTime / 60 == 0) ? 1 : iTime / 60) + "分") : "");
            }
            sTasktarget = sTasktarget + sTemp;
            collectName = null;
            sTemp = null;
        }
        if (MainLogic.getInstance().byGameState == Constant.GAME_UI_TASK_LIST) {
            MainLogic.getInstance().uiInterFace.npcTalk.setTaskTarget(sTasktarget, byTaskType);
        }
        sTasktarget = null;
        break;
    case Constant.MSG_NET_CMD_TIPS_CODE:
        stateCode = cmdData.readByte();//消息的类型(1,系统，2，队伍，3帮派,4,弹出提示框)
        byte byTipType = cmdData.readByte();//具体的消息类型
        int iValue;
        int iValue2;
        String str;
        String str2;
        String str3;
        String temp = "";
        switch (byTipType) {
            case 1:
                iValue = cmdData.readInt();
                temp = "您获得了" + iValue + "经验";
                break;
            case 2:
                iValue = cmdData.readInt();
                temp = "您的修为增加了" + iValue + "点";
                break;
            case 3:
                iValue = cmdData.readInt();
                temp = "您消耗了" + iValue + "点修为";
                break;
            case 4:
                iValue = cmdData.readInt();
                temp = "您获得了" + Tools.moneyConvert(iValue) + "金钱";
                break;
            case 5:
                iValue = cmdData.readInt();
                temp = "您消耗了" + Tools.moneyConvert(iValue) + "金钱";
                break;
            case 6:
                temp = "您还没有完成任务，不能离开";
                break;
            case 7:
                str = cmdData.readUTF();
                temp = "任务“" + str + "”已经完成";
                break;
            case 8:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                iValue2 = cmdData.readInt();
                temp = "已" + str + iValue + " / " + iValue2;
                break;
            case 10:
                temp = "您不能接受该任务";
                break;
            case 11:
                temp = "您的背包已经满了，请先清理背包";
                break;
            case 12:
                str = cmdData.readUTF();
                temp = str + "拒绝了加入队伍";
                break;
            case 13:
                str = cmdData.readUTF();
                temp = str + "加入了队伍";
                break;
            case 14:
                temp = "队伍人数已满，加入队伍失败";
                break;
            case 15:
                temp = "您不是队长，不能邀请别人加入队伍";
                break;
            case 16:
                str = cmdData.readUTF();
                temp = str + "已是其他队伍的成员";
                break;
            case 17:
                temp = "对方已经离开了游戏";
                break;
            case 18:
                temp = "对方已经加入的其他帮派";
                break;
            case 19:
                temp = "帮派人数已经达到了上限";
                break;
            case 20:
                temp = "您没有邀请玩家加入帮派的权限";
                break;
            case 21:
                temp = "邀请玩家加入帮派失败";
                break;
            case 22:
                MainLogic.getInstance().uiPackage.clearPackage();
                MainLogic.getInstance().uiPackage.bShowBAG = false;
                MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                temp = "交易已取消";
                break;
            case 23:
                temp = "对方已死亡";
                break;
            case 24:
                temp = "对方和您不在同一张地图";
                break;
            case 25:
                temp = "对方和您不在同一屏幕";
                break;
            case 26:
                temp = "战场不能切磋";
                break;
            case 27:
                temp = "对方已经离开了游戏";
                break;
            case 28:
                //你占领貔貅,获得int1点个人积分,int2点帮派积分
                iValue = cmdData.readInt();
                iValue2 = cmdData.readInt();
                temp = "您占领了貔貅，获得了" + iValue + "个个人积分," + iValue2 + "个帮派积分";
                break;
            case 29:
                temp = "您占领了貔貅，没有获得任积分";
                break;
            case 30:
                str = cmdData.readUTF();
                temp = "貔貅已经被“" + str + "”帮占领了";
                break;
            case 31:
                //=两只貔貅都被str1帮派占领,str1帮派将在int1分钟后取得胜利
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                temp = "两只貔貅都被“" + str + "”占领了,“" + str + "”在" + iValue + "分钟后取得胜利";
                break;
            case 32:
                str = cmdData.readUTF();
                str2 = cmdData.readUTF();
                temp = str + "在切磋中战胜了" + str2 + "," + str2 + "跪在" + str + "面前哭了";
                break;
            case 33:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                temp = "您的装备“" + str + "”耐久度低于" + iValue + "%，请及时修理";
                break;
            case 34:
                str = cmdData.readUTF();
                temp = "您的装备“" + str + "”耐久度为0，请及时修理";
                break;
            case 35:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                temp = "成功击杀“" + str + "”获得" + iValue + "点帮派积分";
                break;
            case 36:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                temp = "您的宠物“" + str + "”获得" + iValue + "点经验";
                break;
            case 37:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                temp = "您的宠物“" + str + "”升到了" + iValue + "级";
                break;
            case 38:
                iValue = cmdData.readInt();
                iValue2 = cmdData.readInt();
                temp = "成功击杀敌人，获得" + iValue + "个人积分," + iValue2 + "点帮派积分";
                break;
            case 39:
                temp = "成功击杀敌人，没有获得积分";
                break;
            case 40:
                iValue = cmdData.readInt();
                temp = "成功击杀敌人，获得" + iValue + "点帮派积分";
                break;
            case 41:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                iValue2 = cmdData.readInt();
                temp = "已" + str + iValue + " / " + iValue2;
                break;
            case 42:
                temp = "精气不够,不能使用技能";
                break;
            case 43:
                temp = "目标距离太远,不能使用技能";
                break;
            case 44:
                iValue = cmdData.readInt();
                temp = "你的战友击杀落日神将,获得" + iValue + "点帮会积分";
                break;
            case 45:
                iValue = cmdData.readInt();
                temp = "落日神将被打败,将会在" + iValue + "分钟后出现";
                break;
            case 46:
                iValue = cmdData.readInt();
                temp = "你得到轩辕遗民的祝福,获得" + iValue + "点帮会积分";
                break;
            case 47:
                temp = "你得到虎痴的祝福,攻击力得到提升";
                break;
            case 48:
                temp = "你得到玄冥兽的祝福,防御力得到提升";
                break;
            case 49:
                temp = "你得到朱雀幽魂的祝福,气血回复效果得到提升";
                break;
            case 50:
                temp = "你得到龙灵幼兽的祝福,精气回复效果得到提升";
                break;
            case 51:
                str = cmdData.readUTF();
                temp = str + "申请加入帮派!";
                break;
            case 52:
                temp = "帮派传送失败!";
                break;
            case 53:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                str2 = cmdData.readUTF();
                str3 = cmdData.readUTF();
                temp = str + "杀死了" + str2 + ",获得了战利品" + str3 + "×" + iValue;
                break;
            case 54:
                temp = "今日的女娲降福已经开始发放，您在结束游戏时可到七公主处领取当天奖励。";
                break;
            case 55:
                temp = "您已经在对方的黑名单中，不能和对方聊天";
                break;
            case 56:
                temp = "您已经在对方的黑名单中,不能邀请对方组队";
                break;
            case 57:
                temp = "您已经在对方的黑名单中，不能邀请对方入帮";
                break;
            case 58:
                temp = "您已经在对方的黑名单中，不能给对方发送邮件";
                break;
            case 59:
                temp = "回收任务物品错误";
                break;
            case 60:
                temp = "发送消息失败，你被禁言了";
                break;
            case 61:
                temp = "您已经被解禁,可以进行聊天了。";
                break;
            case 62:
                temp = "您被GM禁言了!";
                break;
            case 63:
                temp = "冰封原战场现已经开始报名，各帮派帮主可到冰封原军官处报名参加。|落日谷战场现已经开始报名，各帮派帮主可到落日谷军官处报名参加。!";
                break;
            case 64:
                temp = "冰封原战场报名现已结束，请已报名成功的帮派做好战斗准备。| 落日谷战场报名现已结束，请已报名成功的帮派做好战斗准备。!";
                break;
            case 65:
                temp = "冰封原战场正式开启，满足条件的玩家可进入角逐。|落日谷战场正式开启，满足条件的玩家可进入角逐。!";
                break;
            case 66:
                temp = "冰封原战场结束，请等待下次开启。!";
                break;
            case 67:
                temp = "落日谷战场结束，请等待下次开启。!";
                break;
            case 68:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                iValue2 = cmdData.readInt();
                str2 = cmdData.readUTF();
                temp = str + "购买了您摊位上的" + str2 + iValue + "个,你获得了" + Tools.moneyConvert(iValue2);
                break;
            case 69:
                iValue = cmdData.readInt();
                str = cmdData.readUTF();
                iValue2 = cmdData.readInt();
                str2 = cmdData.readUTF();
                temp = "您购买了" + str + "摊位上的" + str2 + iValue + "个,花费了" + Tools.moneyConvert(iValue2);
                break;
            case 70:
                iValue = cmdData.readInt();
                switch (iValue) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.store.openTrade();
                        break;
                    case 2:
                        temp = "交易失败，对方正在和其他人交易";
                        break;
                    case 3:
                        temp = "对方已经死亡或是下线";
                        break;
                    case 4:
                        temp = "切磋开始";
                        while (MainLogic.getInstance().iLockedObjNumber[0][0] != MainLogic.getInstance().gamePlayer.otherPlayerId) {
                            MainLogic.getInstance().LockedObj_index++;
                            MainLogic.getInstance().lockedObj(MainLogic.getInstance().gamePlayer.iPlayerX, MainLogic.getInstance().gamePlayer.iPlayerY);
                        }
                        break;
                    case 5:
                        temp = "切磋取消，对方正在和其他人切磋";
                        break;
                }
                break;
            case 71:
                temp = "对方已经屏蔽了组队功能!";
                break;
            case 72:
                str2 = cmdData.readUTF();
                temp = "宠物蛋使用成功，获得宠物" + str2;
                break;
            case 73:
                str2 = cmdData.readUTF();
                temp = "任务[" + str2 + "]失败!";
                break;
            case 74:
                temp = "您的挂机状态已结束";
                GameBean.BL_PLAYER_HANGUP = false;
                break;
        }
        switch (stateCode) {
            case 1://系统
                if (!temp.equals("")) {
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, temp);
                }
                break;
            case 2://帮派
                if (!temp.equals("")) {
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 4, temp);
                }
                break;
            case 3://队伍
                if (!temp.equals("")) {
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 3, temp);
                }
                break;
            case 4://弹出窗
                if (!temp.equals("")) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", temp);
                }
                break;
        }
        temp = null;
        str = null;
        str2 = null;
        str3 = null;
        break;
		}
	}

	private void receiverPart2(int msgId, DataInputStream cmdData) throws IOException {
		byte stateCode = 0;
		int i = 0, j = 0;

    	int lMoney = 0;
    	long lPlayerID = 0;
    	String desc = "";
		switch (msgId) {
	case Constant.MSG_NET_CMD_SOCIAL:
        stateCode = cmdData.readByte();
        byte sex;
        if (stateCode == 1) {
            String name = cmdData.readUTF();//姓名
            short lev = cmdData.readShort();//级别
            byte duty = cmdData.readByte();//职业
            sex = cmdData.readByte();//性别
            short tong = cmdData.readShort();//帮派
            short cheng = cmdData.readShort();//称号
            MainLogic.getInstance().pushState(Constant.GAME_UI_VIEW_OTHER_PLAYER, true);
            name = null;
        } else {
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "查看失败", (byte) 1, (byte) -1);
        }
        break;

    case Constant.MSG_NET_CMD_ADD_EXP:
        stateCode = cmdData.readByte();
//    Tools.printLog("升级状态值：" + stateCode);
        int exp = cmdData.readInt();
//    Tools.printLog("增加经验" + exp);
        int maxexp = cmdData.readInt();
//    Tools.printLog("升级需要经验值：" + maxexp);
        byte lev = cmdData.readByte();
//    Tools.printLog("增加级别：" + lev);
        int ep = cmdData.readInt();
//    Tools.printLog("当前经验：" + ep);
        MainLogic.getInstance().gamePlayer.iPlayerXP = ep;
        MainLogic.getInstance().uiEquipment.getChatInformation(100,
                "", (byte) 5, "得到" + exp + "点经验");
        if (stateCode == 1) {//升级
            MainLogic.getInstance().gamePlayer.iPlayerLevel += lev;
            GameBean.L_CMD_PLAYER_OWN_LEVLE = MainLogic.getInstance().gamePlayer.iPlayerLevel;
            Rms.saveGame(Constant.RMS_PLAYER_LEVLE, null);
//        Tools.printLog("当前级别：" + MainLogic.getInstance().gamePlayer.iPlayerLevel);
            MainLogic.getInstance().gamePlayer.iPlayerMaxXP = maxexp;
//        Tools.printLog("升级需要经验值：" + MainLogic.getInstance().gamePlayer.iPlayerMaxXP);
            MainLogic.getInstance().damage.addDamage((byte) -1, MainLogic.getInstance().damage.PLAYER_UPGRADE, 0, false, MainLogic.getInstance().gamePlayer.byPlayerDirection, (int) MainLogic.getInstance().gamePlayer.iPlayerX - MainLogic.gameMap.iMapWorldOffsetX, (int) MainLogic.getInstance().gamePlayer.iPlayerY - MainLogic.gameMap.iMapWorldOffsetY, -45);
            MainLogic.getInstance().uiEquipment.getChatInformation(100,
                    "", (byte) 5, "恭喜您，升到" + MainLogic.getInstance().gamePlayer.iPlayerLevel + "级！！！");
            //////////
            MainLogic.uiInterFace.quickOption.addQuickOption("6|/属性加点", true);
        }
        break;
    case Constant.MSG_NET_CMD_SYNC_TRADE_ITEM:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        if (MainLogic.getInstance().byGameState != Constant.GAME_UI_TRADE) {
            break;
        }
        stateCode = cmdData.readByte();
        lPlayerID = cmdData.readLong();
        if (lPlayerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
            //当前选择物品的是自己
            if (stateCode == 1) {
                if (GameBean.BY_TYPE == 1) {//(1,同步物品，2，同步金钱)
                    if (GameBean.BY_OP_TYPE == 1) {//(1,添加物品，2，删除物品)
                        //添加物品到交易栏(byte byType, long lColumnKey, String sGoodsName, int iIconID, short shGoodsType, short shStackNum, byte byDurability, byte byColor) {
                        MainLogic.getInstance().uiInterFace.store.addTraderItem((byte) 1, -1, null, -1, (short) -1, (short) -1, (byte) -1, (byte) -1);
//                        for (i = 0; i < 14; i++) {
//                            if (!MainLogic.getInstance().uiInterFace.store.myItems.checkColumnHasGoods((short) i)) {
//                                MainLogic.getInstance().uiPackage.clonePackageGoods(MainLogic.getInstance().uiInterFace.store.myItems, (short) i);
//                                MainLogic.getInstance().uiInterFace.store.setTradePackageAlreadySelected((short) i, (byte) 1, (byte) (MainLogic.getInstance().uiPackage.byTabIndex - 1), MainLogic.getInstance().uiPackage.shPos);
//                                MainLogic.getInstance().uiPackage.byIsSelected[MainLogic.getInstance().uiPackage.byTabIndex - 1][MainLogic.getInstance().uiPackage.shPos] = 1;
//                                break;
//                            }
//                        }
                    } else if (GameBean.BY_OP_TYPE == 2) {
                        MainLogic.getInstance().uiInterFace.store.delTraderItem((byte) 1, -1);
                        //交易栏删除物品
//                        for (i = 0; i < 14; i++) {
//                            if (MainLogic.getInstance().uiInterFace.store.myItems.checkColumnHasGoods((short) i) && GameBean.L_CMD_GOODS_SLOTKEY == MainLogic.getInstance().uiInterFace.store.myItems.getGoodsColumnKey((short) i)) {
//                                MainLogic.getInstance().uiInterFace.store.setTradePackageAlreadySelected((short) i, (byte) 0, (byte) -1, (short) -1);
//                                MainLogic.getInstance().uiPackage.byIsSelected[MainLogic.getInstance().uiPackage.byTabIndex - 1][MainLogic.getInstance().uiPackage.shPos] = 0;
//                                MainLogic.getInstance().uiInterFace.store.myItems.deleteGoods((short) i);
//                                break;
//                            }
//                        }
                    }
                } else if (GameBean.BY_TYPE == 2) {
                    //同步金钱
                    MainLogic.getInstance().uiInterFace.store.lMoney = GameBean.I_MONEY;
                }
            } else {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "物品不可以交易");
            }
        } else {
            //同步别人的物品
            if (stateCode == 1) {
                int index = -1;
                short shGoodsType;
                byte opType = cmdData.readByte();
                long lColumnKey;
                byte byDurability, byColor;
                String sGoodsName;
                int iIconID, iStackNum;
                lMoney = cmdData.readInt();
                if (opType == 1) {//添加
                    if (lMoney == 0) {
                        lColumnKey = cmdData.readLong();
                        sGoodsName = cmdData.readUTF();
                        iIconID = cmdData.readInt();
                        shGoodsType = cmdData.readShort();
                        iStackNum = cmdData.readInt();
                        byDurability = cmdData.readByte();
                        byColor = cmdData.readByte();
                        MainLogic.getInstance().uiInterFace.store.addTraderItem((byte) 2, lColumnKey, sGoodsName, iIconID, shGoodsType, (short) iStackNum, byDurability, byColor);
                        sGoodsName = null;
                    } else {
                        //金钱添加
                        MainLogic.getInstance().uiInterFace.store.lTradeMoney = lMoney;
                    }
                } else if (opType == 2) {
                    //删除物品
                    lColumnKey = cmdData.readLong();
                    MainLogic.getInstance().uiInterFace.store.delTraderItem((byte) 2, lColumnKey);
                }
            } else {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "交易出错");
            }
        }
        break;
    case Constant.MSG_NET_CMD_FUNC_REPAIR:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiInterFace.npcTalk.repairEquip(stateCode);
        break;
    case Constant.MSG_NET_CMD_GET_REPAIR_FEE:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        int iMoney = cmdData.readInt();
        if (iMoney > 0) {
            switch (MainLogic.getInstance().byGameState) {
                case Constant.GAME_UI_PET_EQUIP:
                    //MainLogic.getInstance().uiInterFace.pet.openRepairEquip(iMoney);
                    break;
                default:
                    MainLogic.getInstance().uiInterFace.npcTalk.openRepairEquip(iMoney, GameBean.BY_TYPE);
                    break;
            }
        } else {
            if (GameBean.BY_TYPE == 1) {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("修理提示", "您身上的的装备不用修理!");
            } else if (GameBean.BY_TYPE == 2) {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("修理提示", "您背包中的装备不用修理!");
            }
        }
        break;
    case Constant.MSG_NET_CMD_PET_LOCK_SKILL:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiInterFace.pet.petLockSkill(stateCode);
        break;
    case Constant.MSG_NET_CMD_PET_BIND:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiPackage.petBind(stateCode);
        break;
    //改变状态
    case Constant.MSG_NET_CMD_CHANGE_STATE:
        byte playerstate = cmdData.readByte();
        if (playerstate == 2) {
            MainLogic.getInstance().gamePlayer.byPlayerBigState = Constant.PLAYER_BIG_STATE_FIGHT;
            MainLogic.damage.addDamage((byte) -1, MainLogic.damage.PLAYER_INTO_BATTLE, 0, false, MainLogic.getInstance().gamePlayer.byPlayerDirection, (int) MainLogic.getInstance().gamePlayer.iPlayerX - MainLogic.gameMap.iMapWorldOffsetX, (int) MainLogic.getInstance().gamePlayer.iPlayerY - MainLogic.gameMap.iMapWorldOffsetY, (short) -45);
        } else if (playerstate == 0) {
            if (MainCanvas.mainView.bStartIntoBattle) {//清除在屏幕中显示你正在受到攻击
                MainCanvas.mainView.clearByAttack();
            }
            MainLogic.getInstance().gamePlayer.byPlayerBigState = Constant.PLAYER_BIG_STATE_NORMAL;
            MainLogic.getInstance().gamePlayer.blAutoFightIndex = -1;
            MainLogic.damage.addDamage((byte) -1, MainLogic.damage.PLAYER_OUT_BATTLE, 0, false, MainLogic.getInstance().gamePlayer.byPlayerDirection, (int) MainLogic.getInstance().gamePlayer.iPlayerX - MainLogic.gameMap.iMapWorldOffsetX, (int) MainLogic.getInstance().gamePlayer.iPlayerY - MainLogic.gameMap.iMapWorldOffsetY, (short) -45);
            MainLogic.getInstance().clearLockedObj(0, true);
        }
        break;
    case Constant.MSG_NET_CMD_FUNC_HOLE_INFO:
        stateCode = cmdData.readByte();
        if (stateCode == 1) {
            MainLogic.getInstance().uiInterFace.equipment.items.deleteGoods((short) 1);
            MainLogic.getInstance().uiInterFace.equipment.items.deleteGoods((short) 2);
            MainLogic.getInstance().uiInterFace.equipment.items.deleteGoods((short) 3);
            byte byHoleNum = cmdData.readByte();
            byte byGemNum = 0;
            String sGemKey;
            String sGemName;
            String sGemDesc;
            byte byGemColor, byGemLevel;
            int iIconID;
            if (byHoleNum > 0) {
                byGemNum = cmdData.readByte();
                for (i = 0; i < byGemNum; i++) {
                    iIconID = cmdData.readInt();
                    sGemName = cmdData.readUTF();
                    sGemDesc = cmdData.readUTF();
                    sGemKey = cmdData.readUTF();
                    byGemColor = cmdData.readByte();
                    byGemLevel = cmdData.readByte();
                    MainLogic.getInstance().uiInterFace.equipment.items.addGoods((short) (i + 1), true, -1L, (short) -1, sGemName, (short) 1, iIconID, (byte) -1, byGemColor, (byte) -1, (byte) -1, (byte) -1, sGemDesc, byGemLevel, -1, (byte) -1, sGemKey);
                    MainLogic.getInstance().uiInterFace.equipment.items.sGoodsDesc[i + 1] = sGemDesc;
                }
            }
            sGemKey = null;
            sGemDesc = null;
            sGemName = null;
            MainLogic.getInstance().uiInterFace.equipment.getEquipHoleInfo(stateCode, byHoleNum, byGemNum);
        } else {
            MainLogic.getInstance().uiInterFace.equipment.getEquipHoleInfo(stateCode, (byte) 0, (byte) 0);
        }
        break;
    case Constant.MSG_NET_CMD_FUNC_DISMANTLE:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        stateCode = cmdData.readByte();
        String sGemName = null;
        if (stateCode == 1) {
            sGemName = cmdData.readUTF();
        }
        MainLogic.getInstance().uiInterFace.equipment.completeDismantle(stateCode, sGemName);
        break;
    case Constant.MSG_NET_CMD_SYNC_HEALTH:
        int curHp = cmdData.readInt();
        int maxHp = cmdData.readInt();
        MainLogic.getInstance().gamePlayer.iPlayerHP = curHp;
        MainLogic.getInstance().gamePlayer.iPlayerMaxHP = maxHp;
        break;
    case Constant.MSG_NET_CMD_SYNC_MANA:
        int curMp = cmdData.readInt();
        int maxMp = cmdData.readInt();
        //魔法
        MainLogic.getInstance().gamePlayer.iPlayerMP = curMp;
        MainLogic.getInstance().gamePlayer.iPlayerMaxMP = maxMp;
        break;
    case Constant.MSG_NET_CMD_SYNC_PK:
        MainLogic.getInstance().gamePlayer.iPkPoint = cmdData.readInt();
        break;
    case Constant.MSG_NET_CMD_TEAM_ITEM:
        byte byWaitTime = cmdData.readByte();
        byte byItemsNum = cmdData.readByte();
        byte byOoccupation;
        String sItemName;
        char lettler;
        byte byColor,
         byLevel;
        MainLogic.getInstance().uiInterFace.team.sRollItems = new String[byItemsNum * 2];
        for (i = 0; i < byItemsNum; i++) {
            sItemName = cmdData.readUTF();
            byColor = cmdData.readByte();
            byLevel = cmdData.readByte();
            byOoccupation = cmdData.readByte();
            lettler = Tools.getColorReplaceLetter(Goods.getGoodsNameColor(byColor));
            if (byOoccupation != 0) {
                MainLogic.getInstance().uiInterFace.team.sRollItems[2 * i] = "<" + lettler + sItemName + ">，等级：" + byLevel + "，职业需求：" + Tools.getJobName(byOoccupation);
            } else {
                MainLogic.getInstance().uiInterFace.team.sRollItems[2 * i] = "<" + lettler + sItemName + ">，等级：" + byLevel + "，职业需求：无";
            }
            MainLogic.getInstance().uiInterFace.team.sRollItems[2 * i + 1] = "/%" + byColor + "[" + lettler + sItemName + "]";
        }
        sItemName = null;
        MainLogic.getInstance().uiInterFace.team.showItemsRoll(byWaitTime);
        break;
    case Constant.MSG_NET_CMD_TEAM_ROLL:
        GameBean.b_WAIT_NET_MSG_BACK = false;
        byte byPlayerNum = cmdData.readByte();
        String sPlayerNick;
        byte rollReault;
        for (i = 0; i < byPlayerNum; i++) {
            sPlayerNick = cmdData.readUTF();
            rollReault = cmdData.readByte();
            MainLogic.getInstance().uiInterFace.team.rollItemResult(sPlayerNick, rollReault);
        }
        sPlayerNick = null;
        MainLogic.getInstance().uiInterFace.team.bCanRoll = true;
        sPlayerNick = null;
        break;
    case Constant.MSG_NET_CMD_APPLY_TONG_ARENA:
        //战场报名
        stateCode = cmdData.readByte();
        switch (stateCode) {
            case 0:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场报名失败");
                break;
            case 1:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场报名成功");
                break;
            case 2:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您不是帮主，不可以报名");
                break;
            case 3:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场报名还未开放");
                break;
            case 4:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场报名还未开放");
                break;
            case 5:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您的帮派已报名");
                break;
        }
        break;
    case Constant.MSG_NET_CMD_SEND_TONG_ARENA:
        //战场传送
        stateCode = cmdData.readByte();
        switch (stateCode) {
            case 0:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场传送失败");
                break;
            case 1:
                //MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场传送成功");
                break;
            case 2:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您等级不够");
                break;
            case 3:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场未开启");
                break;
            case 4:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "报名帮派不足2个,战场未开放");
                break;
            case 5:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您所在的帮派未报名参加战场");
                break;
        }
        break;
    case Constant.MSG_NET_CMD_DELETE_QUEST:
        //放弃任务
        stateCode = cmdData.readByte();
        if (stateCode == 1) {
            if (MainLogic.getInstance().uiInterFace.npcTalk.bDelPreTaskKey) {
                MainLogic.getInstance().uiInterFace.npcTalk.bDelPreTaskKey = false;
                MainLogic.getInstance().uiInterFace.npcTalk.sPreTaskKey = null;
                MainLogic.getInstance().uiInterFace.npcTalk.byPreTaskType = -1;
            }
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "任务放弃成功");
        } else {
            MainLogic.getInstance().uiInterFace.npcTalk.bDelPreTaskKey = false;
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您不可以放弃该任务");
        }
        break;
    case Constant.MSG_NET_CMD_FUNC_SEND:
        stateCode = cmdData.readByte();
        GameBean.b_WAIT_NET_MSG_BACK = false;
        switch (stateCode) {
            case 0:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "传送失败");
                break;
            case 1:
                break;
            case 2:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "人物等级不够");
                break;
            case 3:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "每个副本每天可以进入5次，您今日该副本的进度已用完。");
                break;
            case 4:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您没有传送所需要的道具!");
                break;
            case 5:
                int x = cmdData.readInt();
                int y = cmdData.readInt();
                Tools.printLog("坐标：" + x + "，" + y);
                MainLogic.getInstance().gamePlayer.changeAction(Constant.PLAYER_STATE_STAND, MainLogic.getInstance().gamePlayer.byPlayerDirection, false, false);
                MainLogic.getInstance().gamePlayer.iPlayerX = x;
                MainLogic.getInstance().gamePlayer.iPlayerY = y;
                MainLogic.getInstance().gamePlayer.resetPosition(x, y);
                MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                break;
            case 6:
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "活动还没有开启!");
                break;
        }
        MainLogic.getInstance().gamePlayer.bChangeSceneLock = false;
        break;
    case Constant.MSG_NET_CMD_PET_CHANGE_ALIAS:
        stateCode = cmdData.readByte();
        MainLogic.getInstance().uiInterFace.pet.changePetAlias(stateCode);
        break;
    //退出游戏
    case Constant.MSG_NET_QUIT_GAME:
        stateCode = cmdData.readByte();
        GameBean.b_WAIT_NET_MSG_BACK = false;
        if (stateCode == 1) {
            if (GameBean.BY_CHANGE_PLAYER_ROLE == 1) {
                MainLogic.getInstance().bClientIsReady = false;
                MainLogic.getInstance().pushState(Constant.GAME_UI_LOADING, true);
                MainLogic.getInstance().uiInterFace.setGameNextState(Constant.GAME_UI_CREATE_ROLE);
                GameBean.BY_CHANGE_PLAYER_ROLE = - 1;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_GET_ROLES, Constant.SOCKET_MSG_TYPE_LOGIC);
            } else {
                MainLogic.getInstance().exitGame();
            }
        } else if (stateCode == 2) {
            MainLogic.getInstance().exitGame();
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您已经被踢出游戏，请重新登录!");
        } else if (stateCode == 3) {
            MainLogic.getInstance().exitGame();
            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您使用了加速，请使用官方客户端!");
        }
        break;
    case Constant.MSG_NET_CMD_CHECK_NEAR_PLAYERS:
        stateCode = cmdData.readByte();
        if (stateCode == 1) {//查看成功
            MainLogic.getInstance().pushState(Constant.GAME_UI_NEAR_PLAYER_LIST, true);
            short playerNum = cmdData.readShort();
            MainLogic.getInstance().uiInterFace.getNearPlayerListNum(playerNum);
            long playerId = -1;
            byte playerDuty = -1;
            int playerLv = -1;
            String playerName;
            for (i = 0; i < playerNum; i++) {
                playerId = cmdData.readLong();
                playerDuty = cmdData.readByte();
                playerLv = cmdData.readInt();
                playerName = cmdData.readUTF();
                MainLogic.getInstance().uiInterFace.getNearPlayerList(i, playerId, playerDuty, playerLv, playerName);
            }
            playerName = null;
        } else if (stateCode == 0) {//查看失败
            MainLogic.uiInterFace.sysMessage.showMessage("提示", "查看失败!", (byte) 1, (byte) -1);
        }
        GameBean.b_WAIT_NET_MSG_BACK = false;
        break;
		}
	}

	private void receiverPart1(int msgId, DataInputStream cmdData) throws IOException {
		byte stateCode = 0;
		int i = 0, j = 0;

		switch (msgId) {
		case Constant.MSG_NET_LEARN_SKILL:
		case Constant.MSG_NET_ADD_SKILL_PLACE:
		case Constant.MSG_NET_UNLEARN_SKILL:
		case Constant.MSG_NET_CLEAN_MERIDIAN:
		case Constant.MSG_NET_CMD_NPC:
		case Constant.MSG_NET_CMD_QUEST:
		case Constant.MSG_NET_XCHANGE_SCENE:
		case Constant.MSG_NET_CMD_OPEN_BAG:
			// 排序物品
		case Constant.MSG_NET_CMD_SORT_ITEM:
		case Constant.MSG_NET_CMD_PUT_ITEM:
		case Constant.MSG_NET_CMD_ADD_ITEM:
		case Constant.MSG_NET_CMD_DELETE_ITEM:
		case Constant.MSG_NET_CMD_USE_ITEM:
		case Constant.MSG_NET_CMD_CHECK_ITEM:
		case Constant.MSG_NET_CMD_LOGIN:
		case Constant.MSG_NET_CMD_GET_ROLES:
		case Constant.MSG_NET_CREATE_ROLE:
		case Constant.MSG_NET_CMD_ENTER_SCENE:
		case Constant.MSG_NET_ENTER_WORLD:
		case Constant.MSG_NET_OTHER_PLAYER_INFO:
		case Constant.MSG_NET_PLAYER_ON_SCREEN_BATTLE:

		case Constant.MSG_NET_CMD_NPC_CHANGE:
			NetDataPro.instance.processMessage1(msgId, cmdData);
			break;
		// //////////////////////////////////
		case Constant.MSG_NET_BATTLE:
		case Constant.MSG_NET_CMD_DELETE_NPC:
		case Constant.MSG_NET_CMD_DELETE_PLAYER:
		case Constant.MSG_NET_CMD_OPEN_EQUIP:
		case Constant.MSG_NET_CMD_USE_EQUIP:
		case Constant.MSG_NET_CMD_DELETE_EQUIP:
		case Constant.MSG_NET_OPEN_KUNGFU:
		case Constant.MSG_NET_CHECK_SKILL:
		case Constant.MSG_NET_CMD_MAIL_HINT:
		case Constant.MSG_NET_CMD_MAIL_CHECKUSER:
		case Constant.MSG_NET_CMD_MAIL_POST:// 发送邮件
		case Constant.MSG_NET_CMD_MAIL_OPEARTION:// 邮件操作
		case Constant.MSG_NET_CMD_MAIL_MONEY:// 查询邮寄金钱
		case Constant.MSG_NET_CMD_CHECK_MONEY:// 查询金钱
		case Constant.MSG_NET_CMD_OPEN_MERIDIAN:
		case Constant.MSG_NET_CMD_SET_QUICK:
		case Constant.MSG_NET_GET_MERIDIAN_DESC:
		case Constant.MSG_NET_LEARN_MERIDIAN:
		case Constant.MSG_NET_CMD_SHOUT:
		case Constant.MSG_NET_CMD_CHECK_DESC:
		case Constant.MSG_NET_DIFF_EQUIP:
		case Constant.MSG_NET_CMD_FIND_PATH:
		case Constant.MSG_NET_CMD_TIPS:
		case Constant.MSG_NET_CMD_ADD_MITZVAH:// 玩家增加修为
		case Constant.MSG_NET_CMD_TEAM_JOIN:
		case Constant.MSG_NET_CMD_TEAM_ANSWER:
		case Constant.MSG_NET_CMD_TEAM_INFO:
		case Constant.MSG_NET_CMD_CMD_NOTICE:
		case Constant.MSG_NET_CMD_NOTICE_LIST:
		case Constant.MSG_NET_CMD_CMD_GUIDE:
			NetDataPro.instance.processMessage2(msgId, cmdData);
			break;
		case Constant.MSG_NET_CREATE_TONG:
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				// 成功
				long tongId = cmdData.readLong();
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "恭喜您，创建帮派成功！", (byte) 1, (byte) -1);
				MainLogic.getInstance().gamePlayer.sTongName = "["
						+ GameBean.STR_CMD_TONG_NO + "]";
				MainLogic.getInstance().gamePlayer.bTongDuty = 4;
				MainLogic.getInstance().gamePlayer.lTongId = tongId;
			} else {
				switch (stateCode) {
				case 2:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "已经加入了帮派");
					break;
				case 3:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "缺少道具");
					break;
				case 4:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "钱不够");
					break;
				case 5:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "帮派名字重复或代号重复");
					break;
				case 6:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "等级不够");
					break;
				case 7:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "创建失败");
					break;
				case 8:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "帮派代号的长度(1个字符)不正确！");
					break;
				case 9:
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "帮派代号必须是帮派名称中的一个字符！");
					break;
				}
			}
			GameBean.STR_CMD_TONG_NAME = null;
			GameBean.STR_CMD_TONG_NO = null;
			GameBean.STR_CMD_TONG_ADS = null;

			break;
		case Constant.MSG_NET_CMD_APPLICATION_TONG:
			stateCode = cmdData.readByte();
			String info = cmdData.readUTF();
			GameBean.b_WAIT_NET_MSG_BACK = false;
			info = null;
			break;
		case Constant.MSG_NET_CMD_TONG_DISMISS:
			stateCode = cmdData.readByte();
			MainLogic.getInstance().gamePlayer.sTongName = null;
			MainLogic.getInstance().gamePlayer.bTongDuty = 0;
			MainLogic.getInstance().gamePlayer.lTongId = -1;
			MainLogic.getInstance().uiEquipment.getChatInformation(100, "",
					(byte) 4, "您所在的帮派被解散了");
			break;
		case Constant.MSG_NET_CMD_TONG_CHANGE_POSITION:
		case Constant.MSG_NET_CMD_TONG_LEAVE: // 离开帮派
		case Constant.MSG_NET_TONG_CHANGE_DESCRIPT:// 修改帮派公告
		case Constant.MSG_NET_TONG_NPC_UPGRADE:// 帮派NPC建筑升级
		case Constant.MSG_NET_TONG_NPC_INFO:// 帮派NPC等级
		case Constant.MSG_NET_CMD_TONG_DESCRIPT:
		case Constant.MSG_NET_CMD_TONG_LIST:
		case Constant.MSG_NET_CMD_TONG_MEMBER_LIST:
		case Constant.MSG_NET_INVITE_TONG:
		case Constant.MSG_NET_BUFF_OPT:
		case Constant.MSG_NET_CMD_DELETE_BUFF:
		case Constant.MSG_NET_CMD_QUEST_LIST:
		case Constant.MSG_NET_CMD_TEAM_DISMISS:
		case Constant.MSG_NET_CMD_TEAM_LEAVE:
		case Constant.MSG_NET_CMD_FUNC_COMPOSE:
		case Constant.MSG_NET_CMD_FUNC_DECOMPOSE:
		case Constant.MSG_NET_CMD_FUNC_COMPOSE_MONEY:
		case Constant.MSG_NET_CMD_FUNC_STRENGTH_MONEY:
		case Constant.MSG_NET_CMD_QUEST_INFO:
		case Constant.MSG_NET_CMD_OPEN_PET:
		case Constant.MSG_NET_CMD_DELETE_PET:
		case Constant.MSG_NET_CMD_PET_FEED:
		case Constant.MSG_NET_CMD_USE_PET:
		case Constant.MSG_NET_CMD_CHECK_PET:
		case Constant.MSG_NET_CMD_FUNC_PET_COMPOSE:
		case Constant.MSG_NET_CMD_OPT_ON_SCREEN:
		case Constant.MSG_NET_CMD_SELECT_PETCOMPOSE_ITEM:
		case Constant.MSG_NET_CMD_NPC_INFO:
		case Constant.MSG_NET_CMD_OTHER_PLAYER_INFO:
		case Constant.MSG_NET_CMD_ADD_MONEY:
		case Constant.MSG_NET_CMD_MOVE_ITEM:
		case Constant.MSG_NET_MODIFY_POSITION:
		case Constant.MSG_NET_CMD_FUNC_HOLE:
		case Constant.MSG_NET_CMD_FUNC_HOLE_MONEY:
		case Constant.MSG_NET_CMD_FUNC_INLAY:
		case Constant.MSG_NET_CMD_FUNC_STRENGTH:
		case Constant.MSG_NET_CMD_FUNC_STRENGTH_RATE:
		case Constant.MSG_NET_CMD_ADD_FRIEND:
		case Constant.MSG_NET_CMD_BE_ADD_FRIEND:
		case Constant.MSG_NET_CMD_FRIEND_LIST:// 好友列表
		case Constant.MSG_NET_CMD_DEL_FREIND:// 读取删除好友
		case Constant.MSG_NET_CMD_OPEN_NPC_STORE:
		case Constant.MSG_NET_CMD_CHECK_STORE_ITEM:
		case Constant.MSG_NET_CMD_CHECK_STORE_DESC:
			NetDataPro.instance.processMessage3(msgId, cmdData);
			break;
		case Constant.MSG_NET_CMD_FUNC_STORE:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			MainLogic.getInstance().uiInterFace.store.setBuyGoods(stateCode);
			break;
		case Constant.MSG_NET_CMD_OPEN_DEPOT:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				byte byDepotType = cmdData.readByte();
				short shMaxColumnNum = cmdData.readShort();
				short shCanUsedColumnNum = cmdData.readShort();
				short shItemsNum = cmdData.readShort();
				MainLogic.getInstance().uiInterFace.store.items = new Goods(
						shCanUsedColumnNum, Constant.ITEM_COLUMN_TYPE_WAREHOUSE);
				int index = -1;
				short shStackNum, shGoodsType;
				long lGoodsKey;
				byte byDuralibity;
				byte byGender;
				short shGoodsLevel;
				String sGoodsName;
				int iIconID;
				byte byJob, byColor, byBind;
				for (i = 0; i < shItemsNum; i++) {
					index = cmdData.readInt();
					lGoodsKey = cmdData.readLong();
					sGoodsName = cmdData.readUTF();
					shStackNum = cmdData.readShort();
					iIconID = cmdData.readInt();
					shGoodsType = cmdData.readShort();
					byDuralibity = cmdData.readByte();
					byColor = cmdData.readByte();
					shGoodsLevel = cmdData.readShort();
					byJob = cmdData.readByte();
					byGender = cmdData.readByte();
					byBind = cmdData.readByte();
					MainLogic.getInstance().uiInterFace.store.items.addGoods(
							(short) index, true, lGoodsKey, (short) -1,
							sGoodsName, shStackNum, iIconID, (byte) -1,
							byColor, byJob, byGender, byBind, null,
							shGoodsLevel, -1, byDuralibity, null);
				}
				MainLogic.getInstance().uiInterFace.store.openWareHouse(
						byDepotType, shMaxColumnNum, GameBean.L_NPC_ID);
				sGoodsName = null;
			} else if (stateCode == 0) {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "打开仓库失败!");
			} else if (stateCode == 2) {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "不能在非本帮派的帮派家园中打开帮派仓库!", (byte) 1, (byte) -1);
			}
			break;
		case Constant.MSG_NET_CMD_FUNC_DEPOT:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			MainLogic.getInstance().uiInterFace.store.storageItems(stateCode);
			break;
		case Constant.MSG_NET_CMD_TRADE_JOIN:
			int lMoney;
			stateCode = cmdData.readByte();
			byte byApplyType = cmdData.readByte();
			if (stateCode == 1) {
				if (byApplyType == 1) {
					// 交易
					GameBean.I_MONEY = cmdData.readInt();
					MainLogic.getInstance().uiInterFace.store.openTrade();
				} else if (byApplyType == 2) {
					// 切磋
					MainLogic.getInstance().gamePlayer.blPkState = true;
					MainLogic.getInstance().gamePlayer.byPlayerBigState = Constant.PLAYER_BIG_STATE_FIGHT;
					while (MainLogic.getInstance().iLockedObjNumber[0][0] != MainLogic
							.getInstance().gamePlayer.otherPlayerId) {
						MainLogic.getInstance().LockedObj_index++;
						MainLogic.getInstance().lockedObj(
								MainLogic.getInstance().gamePlayer.iPlayerX,
								MainLogic.getInstance().gamePlayer.iPlayerY);
					}
					MainLogic.getInstance().uiEquipment.getChatInformation(100,
							"", (byte) 5, "切磋开始！");
					Constant.ITEM_OPERATION_TYPE_RECORD = -1;
				}
			} else {
				if (byApplyType == 1) {
					// 交易
					switch (stateCode) {
					case 0:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方拒绝了您的交易请求！");
						break;
					case 2:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方正在交易中！");
						break;
					case 3:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方屏蔽了交易功能！");
						break;
					case 4:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "您的等级不够15级！");
						break;
					case 5:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方不够15级，不能交易！");
						break;

					}
				} else if (byApplyType == 2) {
					// 切磋
					switch (stateCode) {
					case 0:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方拒绝了您的切磋请求！");
						break;
					case 2:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方正在切磋中！");
						break;
					case 3:
						MainLogic.getInstance().uiInterFace.sysMessage
								.showMessage("提示", "对方屏蔽了交易功能！");
						break;
					}
				}
			}
			break;
		case Constant.MSG_NET_CMD_TRADE_ANSWER:
			String desc;
			long lSponsorID = cmdData.readLong();
			String sSponsor = cmdData.readUTF();
			desc = cmdData.readUTF();
			byApplyType = cmdData.readByte();
			if (byApplyType == 1) {
				// 交易
				GameBean.I_MONEY = cmdData.readInt();
				if (MainLogic.getInstance().uiEquipment.isopenset[1]) {
					MainLogic.getInstance().uiInterFace.store.setTradeAnswer(
							lSponsorID, sSponsor, desc, GameBean.I_MONEY);
				} else {
					// 发起人
					GameBean.L_PLAYER_ID = lSponsorID;
					GameBean.BY_APPLY_RESULT = 3;
					GameBean.BY_TYPE = 1;
					MainLogic.getInstance().send(
							Constant.MSG_NET_CMD_TRADE_ANSWER,
							Constant.SOCKET_MSG_TYPE_LOGIC);
				}
			} else if (byApplyType == 2) {
				// 切磋
				if (MainLogic.getInstance().uiEquipment.isopenset[3]) {
					MainLogic.getInstance().uiInterFace.openContestAnswer(
							lSponsorID, desc);
				} else {// 被屏蔽了
					GameBean.L_PLAYER_ID = lSponsorID;
					GameBean.BY_APPLY_RESULT = 3;
					GameBean.BY_TYPE = 2;
					MainLogic.getInstance().send(
							Constant.MSG_NET_CMD_TRADE_ANSWER,
							Constant.SOCKET_MSG_TYPE_LOGIC);
				}
			}
			sSponsor = null;
			desc = null;
			break;
		case Constant.MSG_NET_CMD_TRADE:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			// 交易
			stateCode = cmdData.readByte();
			MainLogic.getInstance().uiInterFace.store.completeTrade(stateCode);
			if (stateCode == 1) {
				byte tradenum = cmdData.readByte();
				String tradename;
				byte gettradenum;
				for (int a = 0; a < tradenum; a++) {
					tradename = cmdData.readUTF();
					gettradenum = cmdData.readByte();
					MainLogic.getInstance().uiEquipment
							.getChatInformation(100, "", (byte) 5, "获得了"
									+ tradename + "×" + gettradenum);
				}
				tradename = null;
			}
			break;
		case Constant.MSG_NET_CMD_LOCK_TRADE:
			// 锁定交易
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			long lPlayerID = cmdData.readLong();
			if (lPlayerID == MainLogic.getInstance().gamePlayer.lPlayerID) {
				MainLogic.getInstance().uiInterFace.store.bTradeLock[1] = true;
			} else {
				MainLogic.getInstance().uiInterFace.store.bTradeLock[0] = true;
			}
			break;
		case Constant.MSG_NET_CMD_IDEAD:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			if (stateCode == 1) {
				long myId = cmdData.readLong();// 玩家ID
				int level = cmdData.readInt();// 玩家等级
				MainLogic.getInstance()
						.pushState(Constant.GAME_UI_REVIVE, true);
				MainLogic.getInstance().uiInterFace.initRevive(level);
				MainLogic.getInstance().gamePlayer.byPlayerState = Constant.PLAYER_STATE_DIE;
			} else if (stateCode == 2) {
				int hp = cmdData.readInt();// 恢复血气
				int mp = cmdData.readInt();// 回复精气
				int x = cmdData.readInt();
				int y = cmdData.readInt();
				Tools.printLog("坐标：" + x + "，" + y);
				MainLogic.getInstance().gamePlayer.iPlayerHP = hp;
				MainLogic.getInstance().gamePlayer.iPlayerMP = mp;
				Tools.printLog("最大血与当前血：："
						+ MainLogic.getInstance().gamePlayer.iPlayerMaxHP + ","
						+ MainLogic.getInstance().gamePlayer.iPlayerHP
						+ "最大蓝与当前蓝：："
						+ MainLogic.getInstance().gamePlayer.iPlayerMaxMP + ","
						+ MainLogic.getInstance().gamePlayer.iPlayerMP);
				MainLogic.getInstance().gamePlayer.changeAction(
						Constant.PLAYER_STATE_STAND,
						MainLogic.getInstance().gamePlayer.byPlayerDirection,
						false, false);
				MainLogic.getInstance().gamePlayer.iPlayerX = x;
				MainLogic.getInstance().gamePlayer.iPlayerY = y;
				MainLogic.getInstance().gamePlayer.resetPosition(x, y);
				if (MainLogic.getInstance().byGameState == Constant.GAME_UI_REVIVE) {
					MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM,
							true);
				}
			} else if (stateCode == 0) {
				if (GameBean.BL_PLAYER_HANGUP) {// 回城复活
					GameBean.BY_CMD_REVIVE_TYPE = 1;
					MainLogic.getInstance().send(Constant.MSG_NET_CMD_IDEAD,
							Constant.SOCKET_MSG_TYPE_LOGIC);
					GameBean.BL_PLAYER_HANGUP = false;
				} else {
					GameBean.BL_PLAYER_HANGUP = false;
					MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
							"提示", "复活失败", (byte) 1, (byte) -1);
				}
			}
			break;
		case Constant.MSG_NET_CMD_ADD_ATTR_POINT:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			if (stateCode == 0) {
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "加点失败", (byte) 1, (byte) -1);
			} else if (stateCode == 1) {
				MainLogic.getInstance().send(
						Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT,
						Constant.SOCKET_MSG_TYPE_LOGIC);
				MainLogic.getInstance().uiInterFace.sysMessage.showMessage(
						"提示", "加点成功", (byte) 1, (byte) -1);
			}
			break;
		case Constant.MSG_NET_CMD_PK:
			GameBean.b_WAIT_NET_MSG_BACK = false;
			stateCode = cmdData.readByte();
			String mes = null;
			switch (stateCode) {
			case 0:
				mes = "设置失败";
				break;
			case 1:
				mes = "设置成功";
				if (MainLogic.getInstance().gamePlayer.bPkState == 1) {
					MainLogic.getInstance().gamePlayer.bPkState = 0;
					if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_INFO) {
						MainLogic.getInstance().uiInterFace.property.sData[10] = "开";
						MainLogic.getInstance().uiInterFace.property.sData[9] = "关闭中";
					}
				} else {
					MainLogic.getInstance().gamePlayer.bPkState = 1;
					if (MainLogic.getInstance().byGameState == Constant.GAME_UI_PLAYER_INFO) {
						MainLogic.getInstance().uiInterFace.property.sData[10] = "关";
						MainLogic.getInstance().uiInterFace.property.sData[9] = "开启中";
					}
				}
				break;
			case 2:
				mes = "PK值不为0，无法关闭";
				break;
			case 3:
				mes = "之前已经开启了pk状态，无法开启";
				break;
			case 4:
				mes = "等级不够，开启PK状态需要最低等级20级";
				break;
			}
			MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示",
					mes, (byte) 1, (byte) -1);
			mes = null;
			break;

		}
	}
}
